v2.0.0-alpha.4 #3321
markerikson
announced in
Announcements
v2.0.0-alpha.4
#3321
Replies: 3 comments 1 reply
-
Also get this TS issue: |
Beta Was this translation helpful? Give feedback.
1 reply
-
@markerikson I created a small repro and commented on the Immer 10 thread: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is an alpha release for Redux Toolkit 2.0. This release has many changes to our build setup and published package contents, updates the
redux
andredux-thunk
deps to the latest alphas, updates theimmer
dep to the latest 10.x beta, and may have breaking changes.Changelog
ESM/CJS Package Compatibility
The biggest theme of the Redux v5 and RTK 2.0 releases is trying to get "true" ESM package publishing compatibility in place, while still supporting CJS in the published package.
Earlier alphas made changes to the
package.json
contents and published build artifacts in an attempt to get ESM+CJS compat working correctly, but those alphas had several varying compat issues.We've set up a battery of example applications in the RTK repo that use a variety of build tools (currently CRA4, CRA5, Next 13, and Vite, Node CJS mode, and Node ESM mode), to verify that Redux and Redux Toolkit compile, import, and run correctly with both TS and various bundlers. We've also set up a check using a custom CLI wrapper around https://arethetypeswrong.github.io to check for potential packaging incompatibilities.
This release changes the names and contents of the published build artifacts, and the various
exports/module/main
fields inpackage.json
to point to those.We already tried to point to ESM build artifacts as the default. That should hopefully be be more consistent now.
As of this release, we think we have ESM+CJS compat working correctly, but we ask that the community try out the alphas in your apps and let us know of any compat problems!
Dropping UMD Builds
Redux has always shipped with UMD build artifacts. These are primarily meant for direct import as script tags, such as in a CodePen or a no-bundler build environment.
For now, we're dropping those build artifacts from the published package, on the grounds that the use cases seem pretty rare today.
We do have browser-ready ESM build artifacts included, which already have
process.env.NODE_ENV
compiled away for either development or production behavior. These can be loaded via a script tag that points to that file on Unpkg.If you have strong use cases for us continuing to include UMD build artifacts, please let us know!
Immer 10 Beta
Immer 10 is now in beta. It has several major changes, including faster perf, dropping ES5 environment support, and switching from a default export to only named exports.
We've updated RTK to depend on
[email protected]
.Performance testing in an artificial RTKQ stress test project showed significant perf increases when dealing with many RTKQ-connected components loading, and that was directly due to Immer-powered reducers executing much faster.
While reducers are not usually the bottleneck in React+Redux apps, this looks like it will be a very nice improvement!
What's Changed
arethetypeswrong
automated CLI check by @markerikson in Addarethetypeswrong
automated CLI check #3294attw
CLI option to treat problems as non-errors by @markerikson in Addattw
CLI option to treat problems as non-errors #3316Full Changelog: v2.0.0-alpha.2...v2.0.0-alpha.4
This discussion was created from the release v2.0.0-alpha.4.
Beta Was this translation helpful? Give feedback.
All reactions