Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

📹So I got nerd-sniped into making a Trellix clone with TANSTACK React Query over the weekend. I think it works really well, but feel free to disagree. No framework, no backend - just the great msw, vite + RQ SPA. Nice side-effect: it works if you lose network connection 😱

149,183 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

Shout out to @ryanflorence for making a really polished demo. I struggled making the optimistic updates in the UI - lots of concurrent mutations are not easy to get right. So I defaulted to writing to the QueryCache. Bit more code, but works great.

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

I tried to take as much code as possible from the original implementation, so a lot of code should look familiar. One thing I couldn't get to work is the flush-sync-then-scroll approach Ryan did. It might have something to do with how useSyncExternalStore works, not sure.

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

Instead, I converted this to a more declarative callback-ref approach, where items scroll themselves into view when they mount. This works really well apart from needing forwardRef (can't wait for React 19 😂)

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

I also found some edge cases that don't work super well (maybe you do, too?) that we'd have to fix in Query internally, so that alone is totally worth the effort. I like how remix groups mutations together with a key and that could be something for us, too in the future.

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

Overall, I'm quite happy with the result. You can: - play with the demo: - look at the source: Let me know what you think.

Profilbild von Ryan Florence
Ryan Florencevor 2 Jahren

@tan_stack Where's the code and deployment?

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

@tan_stack 3 tweets down

Profilbild von Samuel Cook
Samuel Cookvor 2 Jahren

@tan_stack How many teasing “dude this thing sucks” retweets do you think you’ll get?

Profilbild von Dominik 🔮
Dominik 🔮vor 2 Jahren

@tan_stack I'm happy with it and I learned a thing or two and I don't really care about the rest

Profilbild von freddie
freddievor 2 Jahren

@tan_stack the UX of SPAs is hard to beat, that feels smooth as butter

Ähnliche Videos

⭐️: What am I into these days? These days? These days, I kind of just… I think I’m living in a sort of "no‑thoughts" state. I don’t really have emotional ups and downs, just… I'm calm. I kind of, I don’t really know my feelings these days. It’s not like my emotions are going up and down a lot or anything, but then, when I met a friend of mine and we talked I realized I actually have more worries than I thought. But I also wonder if I just didn’t have the space to talk about them. So, on one hand... I don’t know if I have a lot of worries or if I just don’t have thoughts. With work, work is busy too but sometimes I even wonder if I’m actually busy. Because when you do so many schedules… you don’t really feel it. Like, maybe I am really busy but I just can’t feel it. No, It’s not a slump. It’s pretty far from a slump. A slump is when work doesn’t go well and doing things feels hard, but I’m not like that. When I work, it’s fun and exciting, I just don’t really have emotional highs and lows. So I wonder if maybe this is actually a good thing?That’s how it is. I don’t think you need to worry about this, but actually, I did have a lot of worries and concerns… I just didn’t realize I was worrying about them? Yeah. "Maybe it’s because you haven’t had much time to take care of yourself?" No, but I think I’m actually the type who takes care of myself pretty well. Ah, recently I’ve been going to the sauna alone pretty often and I’ve had some time to think while doing that. No, wait thinking about it, even when I go to the sauna I just sit there without thinking. I think I just space out. I wonder if it’s because I’ve gotten used to this work now. "Maybe your brain just wants to rest." That also feels right. No but, compared to before being thoughtless/empty-minded actually seems better, compared to when I had so many thoughts I couldn’t sleep. Now I sleep with my legs stretched out (idiom, it means to sleep comfortably), yes. Maybe it’s because things feel stable, yes. My relationship with the members is really good and I feel a lot of satisfaction with the work I do, and since ATINY always show me support so strongly by my side, somehow I wonder if that’s why I don’t have emotional highs and lows. #SEONGHWA #성화

Everything Seonghwa

91,617 Aufrufe • vor 4 Monaten