Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
acemarke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
29 ms
·
241.
▲
by
acemarke
4y ago
Good question! The really short answer is: mostly looking at NPM download stats, Github "depended by" numbers, and random polls on Twitter. Which are all _horribly_ flawed metrics, but they're also all we have to go by. I wro
242.
▲
by
acemarke
4y ago
I'd have to disagree with this on a couple levels. Yes, hooks change the way we write React code in some ways, but in a lot of other ways nothing has changed. We still write components that accept props, have state, and return UI desc
243.
▲
by
acemarke
4y ago
I'll put in a plug for BazQux Reader ( https://bazqux.com/ ). I switched to it shortly after Google Reader was killed, and I've used it daily since then. It's simple, the UI is clean, and it _just works_. T
244.
▲
by
acemarke
4y ago
Thank you, glad to hear RTK is working well for you!
245.
▲
by
acemarke
4y ago
Yes, you _can_ actually do that with the listener middleware! We specifically designed that to be possible. When you add a listener entry, there are four options to specify how the middleware knows when to run that listener: 1) `type`: an
246.
▲
by
acemarke
4y ago
Eh, as maintainer, I'd say the complaints about "boilerplate" were generally pretty accurate :) As I've talked about in a couple posts and presentations [0] [1], there's a distinction between "inherent" an
247.
▲
by
acemarke
4y ago
Hah, yeah, the ecosystem landscape has definitely changed over the last few years :)
248.
▲
by
acemarke
4y ago
Yeah, both the React Query and Redux maintainers agree that you shouldn't be writing data fetching and caching logic yourself. That's why we recently added a new "RTK Query" data fetching and caching API to Redux Toolki
249.
▲
by
acemarke
4y ago
Pretty sure you and I debated "vanilla Redux" vs RTK in a thread a couple years ago, but I'll link my most recent explanations of why RTK is the right way to use Redux today: - https://redux.js.org/introductio
250.
▲
by
acemarke
4y ago
Yeah, if you've got any particular use cases or ideas for how you'd like to use them, please put up a discussion thread in the RTK repo and let's talk!
251.
▲
by
acemarke
4y ago
Depends on what you mean here specifically :) I'll agree that the Redux DevTools "skip action" and "jump back to action" features are not all that commonly used in practice. I _maintain_ Redux, and I don't even
252.
▲
by
acemarke
4y ago
To some extent, this was the purpose of the "container/presentational" pattern that was popular for a few years [0]. By splitting your components into "containers", which were responsible for managing data fetching
253.
▲
by
acemarke
4y ago
> Redux is also just an abstraction on top of Context No, this is a very common but incorrect misunderstanding of how Redux works. It's true that React-Redux does use context internally... but only to pass down the Redux store insta
254.
▲
by
acemarke
4y ago
Yeah, _please_ don't use `typesafe-actions` :) It may have had some value before RTK came out, but a lot of the opinions and approaches shown in its docs lead you to write _wayyyy_ too much code. For example, we specifically recommend
255.
▲
by
acemarke
4y ago
Yeah, I'm not questioning whether you _can_ do things with sagas, and there's definitely cases where their capabilities are valuable. But as I put it in my "Evolution" talk: "Sagas are like a chainsaw. Really powerf
256.
▲
by
acemarke
4y ago
One of the reasons we created Redux Toolkit was to eliminate the need to write those switch statements :) (also action type strings, action creators, object spreads, having to split logic for one feature across multiple files, and all the
257.
▲
by
acemarke
4y ago
FWIW, the term "thunk" is a long-standing CS term that long predates Redux [0] [1] [2]. In fact, my first job back in 2008 involved a C++-based emulator/VM framework, and the devs used "thunk" to refer to jumping fr
258.
▲
by
acemarke
4y ago
Fun fact: one of the XState devs did a proof-of-concept showing how to use XState state machines as Redux reducers and integrate the side effects handling as a middleware: https://github.com/mattpocock/redux-xstate-poc
259.
▲
by
acemarke
4y ago
We have docs on code splitting reducers and other Redux logic here: - https://redux.js.org/usage/code-splitting There have been some different community packages for helping with that process, but some of them seem to
260.
▲
by
acemarke
4y ago
FWIW, there _are_ a number of technical and conceptual differences between Context+`useReducer` and Redux. I wrote an extensive post describing those differences and potential use cases for each: https://blog.isquaredsoftware.co
261.
▲
by
acemarke
4y ago
For the record, we actually have recommended _against_ using sagas in most cases for a long time now, and especially for data fetching. Today, our recommendations are: - Data fetching: default to using RTK Query, fall back to thunks if need
262.
▲
by
acemarke
4y ago
Hi, I'm a Redux maintainer. FWIW, we specifically designed our official Redux Toolkit package to not only eliminate the general concerns about Redux "boilerplate" [0] [1], but also work great with TS. With our recommended RTK
263.
▲
by
acemarke
4y ago
> Redux is slowly going out of style it seems I'm a Redux maintainer, and this is actually _not_ the case :) I'll agree that Redux is not quite as popular as it once was, and there's a few different reasons for that. It _
264.
▲
by
acemarke
4y ago
Hmm. While it may not be the immediate answer to your question, my Redux teammate Lenz Weber ( @phryneas ) wrote a Remark plugin that parses TS codeblocks out of Markdown and actually runs them through the TS compiler. As part of that I kn
265.
▲
by
acemarke
4y ago
We do a _lot_ of this in the Redux library repos (examples: [0] [1] [2] ). We have some incredibly complicated types in our libraries, and we have a bunch of type tests to confirm expected behavior. Generally, these can just be some TS fil
266.
▲
by
acemarke
4y ago
Some good discussion on this over in the related Reddit thread: https://www.reddit.com/r/reactjs/comments/vhc30w/why_you_cou... I'll paste in my comment from over there: I have a few nitpicks with t
267.
▲
by
acemarke
4y ago
Reading the article, this sounds _very_ similar to what we do at Replay ( https://replay.io ), which is time-travel debugging for web apps. I'm a front-end dev, so I'm not nearly as familiar with the magic happening on
268.
▲
by
acemarke
4y ago
Yes - you've just described a reducer function (ala Redux and React's `useReducer`). Note that to be a _true_ Finite State Machine, the reducer function would need to be written to first check what state value it's currently
269.
▲
by
acemarke
4y ago
Sure, I'm mentioning the company I work for intentionally, but that's specifically because we make a tool that is designed to help make debugging easier :) And the slideset also seemed like it matched what you were asking for. FW
270.
▲
by
acemarke
4y ago
Definitely not "a lot" - searching the existing docs, I see a mention in the FAQ at https://reactjs.org/docs/faq-functions.html#how-do-i-bind-a-... , but not really elsewhere. Also, the new React beta docs at
More ›