Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
acemarke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
181.
▲
by
acemarke
4y ago
FWIW, my estimates show that Redux is still used by 35-40% of React apps [0]. That's definitely less than it was a couple years ago, but still the largest usage of any React-related state lib by far. (It's also worth noting that
182.
▲
by
acemarke
4y ago
For the record: I maintain Redux, and it's never been an actual recommendation from the React team. In fact, Dan has publicly stated that "the only state management tool we recommend is React itself". Redux is certainly the
183.
▲
by
acemarke
4y ago
I wouldn't say that at all. The React Core team was 100% Meta up until earlier this year, when Seb Markbage switched to Vercel (and I believe Vercel is now also funding an additional full-time dev to contribute more React SSR / Se
184.
▲
by
acemarke
4y ago
Yeah, sagas can be useful - not saying they aren't. But on the other hand, I've seen plenty of codebases and talked to lots of Redux users where sagas turned into an impenetrable spaghetti mess of actions and events going everywhe
185.
▲
by
acemarke
4y ago
Hmm. Lenz ( @phryneas in most places) could speak more to some of this, but I don't think RTKQ really supports the idea of "canceling" a fetch in general. Can you give some specifics about what that means in your case? As fo
186.
▲
by
acemarke
4y ago
HAH! and ironically I read this literally 10 minutes after you posted it :) dons maintainer hat <ObligatoryResponse> We've been generally recommending against use of sagas for years - they're a power tool, and very few app
187.
▲
Redux Toolkit 1.9: new RTK Query options, `upsertQueryData`, faster RTKQ perf
(github.com)
1 points
by
acemarke
4y ago
|
0 comments
188.
▲
by
acemarke
4y ago
Yes, Redux Toolkit is still Redux. There's still a single store, dispatching "action" objects that describe "what happened in the app", and pure "reducer" functions that calculate new state immutably in re
189.
▲
by
acemarke
4y ago
Hi, I'm a Redux maintainer. A few thoughts: First note is that while both of Redux's original creators (Dan Abramov and Andrew Clark) later got hired to work on the React team, Redux has always been an independent project, and is
190.
▲
by
acemarke
4y ago
Very nice bit of archeology! Back in 2017, about a year after I took over as Redux maintainer, I wrote up a post exploring some of how Redux works, its design constraints, and the intended goals and influences: - https://blog.isq
191.
▲
by
acemarke
4y ago
Yep, Redux usage has changed _significantly_ in the last few years :) Also see these talks I did on "modern Redux with RTK" and "the evolution of Redux async logic": - https://blog.isquaredsoftware.com/20
192.
▲
by
acemarke
4y ago
I wrote a post a couple years ago about how I do daily work journals: - https://blog.isquaredsoftware.com/2020/09/coding-career-advi... Since then, I've switched tools. I now use VS Code to write a Markdown f
193.
▲
by
acemarke
4y ago
Please note that "modern Redux" code is very different than what most older tutorials show. We've introduced newer APIs like Redux Toolkit, which is a set of utilities that simplify the most common Redux tasks, and the React-
194.
▲
by
acemarke
4y ago
I'd strongly recommend checking out Swyx's book "The Coding Career Handbook". It has a _ton_ of useful advice for working on your career: - https://learninpublic.org/ I've got a few "career&qu
195.
▲
by
acemarke
4y ago
I'm legitimately curious. Can you point to a single actual source to cite "the React team made the change to hooks because of JS engine performance"? (and when you say "performance", you _are_ talking about literal
196.
▲
by
acemarke
4y ago
I think you're really misunderstanding how React works here. There's no "thrashing" involved, in the sense of "make DOM update A, then need to make B that reads layout or does reflows right after". - React does
197.
▲
by
acemarke
4y ago
You're very much misreading what I said. It's not about "optimization" in the sense of "how fast can the v8 interpreter execute lookups on the class instance" or anything like that. It's about "when t
198.
▲
by
acemarke
4y ago
Not sure what you mean by "nightmare" - can you clarify?
199.
▲
by
acemarke
4y ago
> it also only bales out during the DOM update phase; not during the calls to render() and then reconciliation(?) It's exactly the opposite. React splits work into two parts: the "render phase", where it loops over compon
200.
▲
by
acemarke
4y ago
Hooks had nothing to do with v8 optimizations or `this.state`. Per https://reactjs.org/docs/hooks-intro.html , the primary motivations were: - "It’s hard to reuse stateful logic between components " - "C
201.
▲
by
acemarke
4y ago
Yep. The article has some good points overall, but Context was definitely never intended as a replacement for Redux. Redux and Context are different tools that solve different problems, with some small overlap. Honestly, this is a point of
202.
▲
by
acemarke
4y ago
Anything particular you want to know about it? Assuming you're asking more along the lines of "how does it work internally?", these are my usual recommendations: - My own extensive post "A (Mostly) Complete Guide to Reac
203.
▲
by
acemarke
4y ago
I see people ask on a literal daily basis "does Context replace Redux?". So, I was trying to make a few points in that post, mostly clarifying common misconceptions, because the question itself is rooted in some major misundersta
204.
▲
by
acemarke
4y ago
FWIW, Redux and Context are different tools that solve different problems, with some overlap. Context is a Dependency Injection tool for a single value, used to avoid prop drilling. Redux is a tool for predictable global state management, w
205.
▲
by
acemarke
4y ago
FWIW, one specific counter-example would be Etsy choosing to adopt Preact to migrate upwards from React 15: - https://github.com/mq2thez/blog/blob/main/upgrade-react-etsy... - https://www.etsy
206.
▲
by
acemarke
4y ago
Oh hey, that's my post. Don't expect this to get much discussion, but hopefully it's useful!
207.
▲
by
acemarke
4y ago
I'm afraid I'll have to disagree with all of the above, especially the part about building libs. Per the OP's article and my slides, there _are_ many aspects of maintaining a lib that are unique to TS above and beyond a plain
208.
▲
by
acemarke
4y ago
That's... not at _all_ what the author said. Summarizing the sections: - Documentation: there's docs on how to use the language as a whole, but nothing focused on writing libraries (how to build/publish, type tricks that libr
209.
▲
by
acemarke
4y ago
Hi, I'm a Redux maintainer. As my co-maintainer Lenz Weber just said on Twitter: > No other language I know allows us library authors to have that much influence on autocomplete and dev experience. We could all just ship mediocre t
210.
▲
by
acemarke
4y ago
I'm very curious, which "Redux code" are you referring to here? I don't think the `redux` core lib ever shipped any Flow types itself. Looking at the FlowTyped repo, I see community typedefs at https://github
More ›