I wish React removed all the compatibility code it has with Internet Explorer and the likes and worked on minimising the weight. Also the synthetic events reactivity system seems a bit outdated.
We plan to do this in a close follow up release! Automatic batching was one important step, because it starts to treat native events the same as events that goes through the synthetic event system. The rest will be a bigger breaking change for some folks though, so we didn't want to include it in this release, which is focused on giving users a smooth upgrade to start using concurrent features.
We've announced removal of IE support but we haven't actually removed the related code. We will likely do that in React 19 together with other breaking changes to the React DOM bindings. I wouldn't expect this to dramatically cut the size. Overall, we tend to focus on changes that increase the performance of the application holistically (see https://twitter.com/reactjs/status/1508847169905864707 and next several tweets) rather than focus solely on the bundle size of React itself (which is fixed and becomes a smaller % as the app grows). But we've definitely accumulated some cruft we'd like to drop sooner rather than later.
That’s the size of the folder and its dependencies in node_modules, not the size of what gets sent over the network. You’re looking for Bundlephobia [1].
react itself is also tiny; it only adds 2.5kb to your bundle size [2] (a 300b reduction from v17). react-dom is the much larger dependency, although as of right now Bundlephobia errors out when trying to analyze the newest version [2].
EDIT: they’ve got react-dom@18.0.0 working now and it’s indeed slightly bigger than the previous version: 41.7kb vs 39.4kb.
I remember danabramov claiming more than once on twitter to people praising preact's bundle size, that it also came with a performance cost when it came to diffing and rendering because React had much more code to handle the many edge cases where preact would hit walls.
Shoot. You’re right. Here’s the quote from a preview release:
“In this release, React is dropping support for Internet Explorer, which is going out of support on June 15, 2022. We’re making this change now because new features introduced in React 18 are built using modern browser features such as microtasks which cannot be adequately polyfilled in IE.
If you need to support Internet Explorer we recommend you stay with React 17.”
Not the OP, but we have an IE support requirement that comes from the NHS. They do actually seem to have Chrome available on their machines these days, but they didn't when we signed the contract and lots of their users still use IE11 so we'll be continuing to support it at least until the June deadline.
They'll almost certainly be on LTSC windows which I think means they can continue to use IE11 with security updates beyond the deadline, but we might be able to persuade them to drop the requirement on us at that point.
If it weren't for 3rd party libraries I wouldn't actually mind supporting IE11 too much. It's no IE6. But not being to upgrade libs is a problem!
You’re right that IE 11 isn’t too bad. The other day I was looking around and discovered it supported web sockets. It does have some surprisingly new stuff you think would be missing.
But my main pain point is some relatively simple JavaScript syntax that’s missing. () => {} is a big one. Support for fetch is another.
If it had support for those two things I bet a huge chunk of my shimming and polyfills could be avoided. I can work around other things. But those two just feel too fundamental at this point.
There would be other benefits. Obviously IE 11 is a joke in JS execution speed compared to other browsers, but what would you expect from something that old.
We have one app left that a handful of customers still use in a mode that requires Java applets. Yes, you read that right. We’ve been trying to sunset that feature for a long time but I don’t think a date has been decided yet. If it has it’s probably at least a year in the future.
Some of the fun of the enterprise software world. I’ve wanted to drop it for years. And our JS bundle would shrink a ton without it. One day.
For me: 0.5% of our customers use it, which means as soon as we break IE we get a flood of customer support inquiries. Since we're B2B, the end users using our product often aren't the ones choosing their browser so we can't tell them to just use Chrome.
https://www.solidjs.com is quite awesome but lacks the React ecosystem.