Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
acemarke
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
59 ms
·
571.
▲
by
acemarke
6y ago
FWIW, Redux has never been pitched as "an effort to make React more opinionated". It's always been about trying to make state management more predictable. See my post "The Tao of Redux, Part 1: Implementation and Intent&
572.
▲
by
acemarke
6y ago
From my perspective, the sequence was: - From 2008-2014, _everyone_ was writing their own "class-like" abstractions (see: Backbone, Class.js, five million other "inheritance" libs). So, the React team wrote `createClass`
573.
▲
by
acemarke
6y ago
Highly recommend Docusaurus, published to Netlify. We use it for the Redux family of libraries (Redux, React-Redux, Redux Toolkit), and have been very happy with it.
574.
▲
by
acemarke
6y ago
Strictly speaking, nothing says a reducer even _has_ to have a switch statement. A reducer can use _any_ conditional logic it wants inside: `if`, `for`, `while`, lookup tables, etc. It's just that the most obvious conditional construct
575.
▲
by
acemarke
6y ago
I'm still using FF68 on Android. At the moment, I've got three extensions installed, on a new profile: uBlock Origin, Stylerific, and Display Anchors. Granted, the latter two are for niche use cases. But, the point is they exist,
576.
▲
by
acemarke
6y ago
Because the new version was pushed out without warning, wiped out the ability to use all but a handful of extensions, and made drastic changes to the UI: https://news.ycombinator.com/item?id=24269168
577.
▲
by
acemarke
6y ago
We see this all the time today over in the Reactiflux channels on Discord. We've got a bot that will show pre-recorded answers for common topics when we ping it, and one of the most frequently used ones is exactly this: https:/&
578.
▲
by
acemarke
6y ago
Honestly, the only alert I have is a Tweetdeck search for hashtag `#redux`. Other than that, I just spend too much time on social media :)
579.
▲
by
acemarke
6y ago
I know I'm feeding a troll here, so last response. I've looked at hundreds of other codebases, ranging from beginner apps to complex enterprise-level apps. I've talked to thousands of people who are using Redux in many, _man
580.
▲
by
acemarke
6y ago
Two, because I've spent the last 9+ years of my career working on the same couple apps :) But both were pretty complex - true SPAs, no routing, lots of complex client-side state manipulation going on. In fact, the first one is actually
581.
▲
by
acemarke
6y ago
> The problem with his style is that he parades himself as an expert but he's emphatically not an expert Erm... I've been a Redux maintainer since mid-2016. I oversaw development of React-Redux v5 and v6, wrote v7 by myself, a
582.
▲
by
acemarke
6y ago
FWIW, my current estimates are that roughly 50% of all React apps use Redux. I'm gonna go out on a limb and guess that maybe 1/3 of those Redux-using apps probably aren't really benefiting from Redux (things like using it _ju
583.
▲
by
acemarke
6y ago
Or, with `createSlice`, you get the action creators for free with your reducers: const todosSlice = createSlice({ name: 'todos', initialState: [], reducers: { addTodo(state, action) { cons
584.
▲
by
acemarke
6y ago
I'll have to disagree with that, on multiple levels. Thunks are simply an approach for writing reusable async logic that has access to `dispatch` and `getState`, without being tied to a specific store [0]. While I do think more people
585.
▲
by
acemarke
6y ago
I certainly get where you're coming from, and agree that all of the questions you listed are things we didn't express opinions on previously and had to decide for yourself. Still, the bulk of the concerns I've seen over time
586.
▲
by
acemarke
6y ago
> I really do think if Redux hadn't been so concerned about being opinionated way back when, it'd be far better received today Can you clarify what you mean here? From my perspective as a Redux maintainer, most of the concerns
587.
▲
by
acemarke
6y ago
`symbol-observable` is just a polyfill lib for `Symbol.observable()`. Worst case, we copy-paste the 2 lines of code directly into our codebase just to remove that dependency. The Redux store will still implement the observable contract.
588.
▲
by
acemarke
6y ago
Yeah, Dan's pointed out a number of times that even with FP and immutability, _local_ mutation is fine. After all, the mechanism for immutable updates is to make copies of the original data, and then mutate / overwrite pieces of t
589.
▲
by
acemarke
6y ago
Which is why the current JSX syntax uses that as a synonym for `disabled={true}`. Agreed that it matches HTML better, but having written an awful lot of `someLongVariableName={someLongVariableName}`, I sure wish I could stop repeating myse
590.
▲
by
acemarke
6y ago
Trust me, I'm well aware of both of those facts :) Doesn't mean the syntax _can't_ change . After all, the `<>` shorthand syntax for fragments was added via cooperation with the Babel and TypeScript teams, and the work
591.
▲
by
acemarke
6y ago
I'd still _loooove_ to have "prop punning", ie, shorthand passing of props based on local variable names equivalent to ES6 object literal shorthand: <MyList items selectedItem onItemClicked /> Doesn't
592.
▲
by
acemarke
6y ago
Thanks! Quick summary: Immer is an incredibly useful immutable update library, created by Michel Weststrate (author of MobX). It exports a single function `produce(originalState, updateCallback)`. The callback receives a `draftState` value
593.
▲
by
acemarke
6y ago
`redux@^4` currently has two dependencies: `symbol-observable` for compat with observable libs, and `loose-envify` for compat with Browserify. I plan on removing both of those when we release Redux v5. Our official Redux Toolkit package [0]
594.
▲
by
acemarke
6y ago
Last time I checked, it's a direct competitor / reimplementation of Babel in Rust.
595.
▲
by
acemarke
6y ago
Two immediate potential benefits: - Only one tool to configure, instead of many - Many tools revolve around parsing your code and generating an AST, then manipulating / processing that AST (Prettier, ESLint, Babel, TS, Webpack, ....).
596.
▲
Rome: A Linter for JavaScript and TypeScript
(romefrontend.dev)
303 points
by
acemarke
6y ago
|
136 comments
597.
▲
by
acemarke
6y ago
Here's a better set of charts, using the `npm-stats` site: https://npm-stat.com/charts.html?package=jshint&package=esli...
598.
▲
by
acemarke
6y ago
RTK doesn't change anything about how you write reducers and actions that need to interact across slices. Our recommendations have always been the same: reorganize slice reducers so they handle more state, put more data in actions, or
599.
▲
by
acemarke
6y ago
Side note: I just published a brand-new "Redux Essentials" core docs tutorial. It teaches beginners "how to use Redux, the right way", using our latest recommended tools and practices, including Redux Toolkit for writin
600.
▲
by
acemarke
6y ago
Stats-wise? Looks like about a 60% drop-off atm. Content-wise: Part 1 is Redux terms/concepts/"why would I use this?", while Part 2 is a walkthrough of a Redux Toolkit "counter" example to illustrate all the pi
More ›