Post

i've started on a rewrite of the React Compiler docs thanks to the feedback from this thread: bsky.app/profile/nmn.... i want to make our compiler docs really great before the stable release, so i would love to hear more feedback! github.com/reactjs/reac...

github.com[compiler] Rewrite React Compiler Docs by poteto · Pull Request #7868 · reactjs/react.devWe've received feedback that the compiler docs are difficult to understand and not prominent enough that people don't realize the compiler is a serious project and is near stable. This PR r...

8 reposts49 likes

I’d love to see some rough numbers on what sort of performance gains one might expect in the real world. I understand this is peak “it depends” territory, but what gains did Facebook or early adopters report? Is there a trade-off to between first render cost and re-render speedup?

What we've generally found is that the bundle-size increase is quite small after gzip. We also saw that it wasn't just re-renders that got faster but also initial load, as often times components have to render multiple times even on the very first page load in order to fully settle.

so overall the performance improvements outweighed any regressions from having a slightly bigger bundle.

Also the processedData to <Item>s map would make new elements every time anyways, so that should me memoized. Or if point was only to illustrate avoiding expensiveProcessing, then I’d say remove the unrelated code as it distracts from what is trying to be shown.

lol yeah it was intentional to subtly show how easy it is to get wrong. I agree though on slimming the code example down to more clearly make the point. Thanks for the feedback!

Something I find strange with React Compiler (and also the docs here) is how React.memo is compiled: In the 1st image, we can see that using or not `React.useMemo` results in the same output (which is 100% expected). But in the 2nd image, `React.memo` has a different output

This discussion had been helpful as I didn't realize there was now react 18 compat, but might it be worth documenting that the babel plugin is just a first step and that other integrations will happen down the road? I did find this very encouraging! github.com/oxc-project/...

github.comReact Compiler oxc plugin · Issue #10048 · oxc-project/oxcI wanted to open an issue capturing some of our past discussion on adding support for React Compiler as an oxc plugin. For context, the React team reached out to both the swc and oxc projects a few...