5 ms·
React Internals (2017)
- kreetx 5y agoThis is pretty interesting, how much has since 2017? Probably the new hooks but other than that?
- gherkinnn 5y agoReact 16 brought along new internals: https://reactjs.org/docs/faq-internals.html https://reactjs.org/docs/faq-internals.html
- pomber 5y agoThis one was updated after fiber and hooks: https://pomb.us/build-your-own-react/ https://pomb.us/build-your-own-react/
- ofou 5y agoThanks for sharing!
- spenrose 5y agoGreat work!
- game_the0ry 5y agoThat was a really pleasant UX. Well done.
- foogazi 5y ago(2017) or React 15.3 Internals
- deleted 5y ago[deleted]
- echelon 5y agocomponentWillMount()? This is ancient. Before the pandemic, even.
- nsonha 5y agoyeah that's BC (before Covid)
- Graffur 5y agoHow long before react updates to doing things the svelte-way?
- curtisf 5y agoThe biggest strength of React is that it is _just_ a library. You don't need to write JavaScript/TypeScript in a special way (other than limiting side effects, which is not a React-specific challenge). Svelte is not JavaScript. Svelte is a compiler that significantly changes the way code is executed, despite being superficially quite similar. Samples of code that look like they would be equivalent in JavaScript are not equivalent in Svelte. This can be good for easily reaching a performant version, but it's also a major drawback. Reconciling these approaches seems quite difficult--maybe the tsx compiler could begin to recognize some common patterns that can be compiled to simple in-place updates. But it would be brittle, since React is more expressive in that it allows lots of code that _can't_ be straightforwardly transformed into efficient in-place updates.
- Graffur 5y agoSvelte is pretty much JavaScript. Which samples work in JavaScript but not Svelte? I would guess that 90%+ of all React written goes through a compile/transpile step in the development process which makes the difference between writing React apps and Svelte apps negligible. I actually went back to React after using Svelte but I think the compile step makes more sense since you're not delivering the library to the end user.
- nsonha 5y agothe last React version that feels pragmatic. The APIs introduced after this are poorly designed in my opinion, the "function as children" context API (and TWO other ways to access context) and hooks
- chakkepolja 5y agoI don't get why hooks were introduced. It's just some magic that doesn't feel like JS.