News for hackers. Stuff that matters.
Re:Understanding React Compiler by throwAGIway on Saturday June 29, 2024 @04:53PM (#40833281)
So this package is not the actual react-dom package I get when I npm install react-dom? Thanks for the correction!
Re:Understanding React Compiler by acemarke on Sunday June 30, 2024 @12:03PM (#40837959)
The `react-dom` NPM package includes multiple different JS bundles that are used for different purposes. See that `unpkg` link I pasted in the parent comment.

There's 3 different flavors of `react-dom` for use in the client (dev, prod, profiling), and then several variations of `react-dom` for use _on the server_.

The client bundles don't include any of the server functionality.

_None_ of the bundles are treeshakeable at all, because A) they're shipped as CommonJS modules and not ESM, and B) the way the React library is written and architectured as a whole. All of the reconciler logic is intertwined and unshakeable, so even if React did suddenly switch to shipping ESM modules instead of CJS, it would still end up as the exact same bundle size.