Re:React v18.0
by danabramov on Tuesday March 29, 2022 @02:03PM
(#30846205)
“State transition” is a well-established concept, which applies here. We’re also planning to eventually integrate this feature with animations, which would match the other meaning of “transition”. This is why we settled on this term. We get similarly criticized when we come up with our own names for features, so it’s a tricky balance.
I don't get how "layers and layers of abstraction/concepts that are hard to grasp for a newcomer" is your critique here? The literal entirety of tech is layers and layers of abstraction. Also, just because the improvements or new concepts are going to be difficult for newcomers to grasp doesn't mean they are objectively bad. The fact that things are going to be difficult for newcomers should not be an impeding factor on whether or not to build upon existing features. There are ways for newcomers to build up their way to eventually learn the advance concepts. Newcomers are not forced to go from 0-100 on day 1
I’m pretty sure they’re not claiming to have invented transitions. They maybe should have said “a new concept to React” rather than “a new concept in React”.
In this specific context, can Preact be considered a more "reasonable" React offering? Or does it follow each and every feature of React?
It's definitely a much simpler react-like library. You don't get the React ecosystem though. If you're looking to step out beyond React, inferno is also worth considering. It focuses on performance rather than bundle size (it's smaller than React, but bigger than Preact).
Re:React v18.0
by rschristian on Tuesday March 29, 2022 @06:32PM
(#30849201)
> You don't get the React ecosystem though.
Well this is an odd thing to say, as there's a whole dedicated compatibility layer. That's not to say it's 100%; relying on specifics of synthetic events, such as bubbling through portals, for example, won't work but it's a drop-in replacement for many users.
Take a peek at https://preactjs.com/guide/v10/switching-to-preact/
I'm also confused by the `useTransition` idea, to be honest I don't exactly know when or where I would use it after reading about it. Sounds like a specific optimization tactic.
Re:React v18.0
by danabramov on Tuesday March 29, 2022 @02:14PM
(#30846353)
Over time, we expect that in most cases you wouldn’t use it directly. Instead, a router might use it for route changes, for example, automatically marking them as transitions. This would make it possible for the user to click a link in the middle of rendering, and immediately handle it instead of being blocked until the render completes.
I see, that makes sense. Thanks for the explanation!
And, more irksome to me, they don't keep their docs up to date.
The beta React docs _still_ don't even document the useEffect hook.
Re:React v18.0
by danabramov on Tuesday March 29, 2022 @02:41PM
(#30846676)
The beta React docs are beta because they're incomplete. The stable docs have the entire API documented.
> A transition is a new concept in React to distinguish between urgent and non-urgent updates.
> Urgent updates reflect direct interaction, like typing, clicking, pressing, and so on. > Transition updates transition the UI from one view to another.