-
Notifications
You must be signed in to change notification settings - Fork 46.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for minor release of 17.0.3 to support ESM packages #24095
Comments
Just encountered this. This causes a major compatibility headache between React 17 and React 18. |
I'll add this to our list of topics to discuss. Many libraries are cutting majors for 18+ though since there are often other changes for compatibility that might depend on new APIs. |
Is there any situation in which this change would be breaking? |
We've had a discussion about this. React 18 is out, so at least this is out of the way. Classic JSX runtime is supported in both versions (and doesn't warn) so it should not be a blocker per se for libraries wanting to support both 17 and 18. This originally broke because environments have gotten more restrictive (to follow Node.js). E.g. if I recall correctly, it used to work with webpack 4 but broke with webpack 5. So React didn’t narrow down the compatibility — it’s the tooling upgrade that did. With the amount of churn around ESM resolution and related tooling, we think it is too risky to add |
I understand the hesitancy and I don't know what it takes to cut a React release for non-main branches (perhaps it is very manual and time-consuming), but to play devil's advocate, there shouldn't be that much harm in cutting 17.0.3 and then 17.0.4 in case there are any issues? If there turn out to be no issues, then a lot of users would be happy.
Just curious, what separation of behaviours are you referring to? |
It is often tempting to do something like this. But it’s hard to predict what will happen. Maybe you release one version and it breaks some people. Some people work around it. Eventually someone reports it. You have to determine how common the issue is. Eventually maybe you decide to revert. But then you can break people who have already fixed their code to work with the previous patch. And people who relied on the original fix have to go back too. By that time people write wrong StackOverflow articles etc. It’s a mess. We don’t want to teach people that a patch is scary to update to. We’ve been using patches only for critical fixes lately. So this would have to be a minor. And then another minor to undo it. This is too much of a risk and distraction when we already have a release that works. |
This was previously requested: Request for Package Release
The
package.json
of17.0.2
does not specify theexports
field. If a package is of typemodule
and using React it will break when using the automatic JSX runtime, since the import (usually inserted by transpilers likeswc
) will be:But for ESM modules (when not specified in
exports
) it should be:May I ask if the React team could release a new minor version of
17.0.3
even if it is just an updatedpackage.json
with no other code changes, since it will contain these exports:Original Source
I know React 18 is coming (and does have these fields specified), but without an update to React 17, a native ESM package that uses React will either be forced to not use the automatic runtime or only support React 18.
Edit:
This should also fix this issue and this MUI blocker.
The text was updated successfully, but these errors were encountered: