-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
fix: Use .esm.js module for backwards compatibility with old build tools #939
Conversation
✅ Deploy Preview for quizzical-lovelace-dcbd6a canceled.
|
Pull Request Test Coverage Report for Build 2312748447Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Thanks @cdauth Fwiw, the same PR you did with a breaking change flag would have been just fine. What's the process to have this merged and released ? |
Merging this PR blindly to hopefully fix the issue! (I'm so tired of ESM) |
🎉 This PR is included in version 9.0.14 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I can confirm it fixed it for react-native. |
Yes, things are back to normal. Thank you @cdauth and @mweststrate for the quick fix |
Thank you @cdauth @mweststrate and @f-roland |
Some people have reported trouble with the new release of immer, in particular in #937 and #921. The reason seems to be that older build tools are having trouble to understand
.mjs
files as JavaScript.Since currently immer publishes both an
.esm.js
and.esm.mjs
bundle (introduced in #921), with the whole purpose of being backwards compatible, in this pull request I'm reverting themodule
and other fields inpackage.json
to using the.esm.js
bundle, while only theexports
field uses the.esm.mjs
bundle. I'm hoping that this will achieve both compatibility with Node.js as well as ancient build tools.