You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently working on major versions for all of the Redux-related packages: RTK 2.0, Redux core 5.0, Reselect 5.0, and Redux-Thunk 3.0.
The primary driver for this is updating package formats for full ESM/CJS compatibility, as well as modernizing JS output.
I originally was not planning to publish a new major for React-Redux. It's been pretty stable ever since we released v8, with only a few minor TS types tweaks.
HOWEVER, we've decided it's worth doing a new major version after all.
One motivation is to address potential compat issues with React Server Components. Specifically, it seems that just callingReact.createContext() in an RSC environment throws errors. React-Redux exports the ReactReduxContext singleton instance, and it's created on initialization as soon as you import from the package. This means importing one of our hooks throws an error inside of RSCs, and RTK Query's React-using createApi method tries to generate hooks.
We've got an idea for working around that ( see #2025 ), but it's probably still worth coming up with a fuller solution.
Additionally, it is worth doing the same ESM/CJS packaging changes we've done in our other libraries.
Finally, React 18 has been out for a year. When we shipped v8, we defaulted to using the useSyncExternalStore "shim" package for compatibility with React 16-17. The shim adds some extra bytes to all consumers, even if you're using React 18. We can swap that now to only use the actual uSES hook, and require React 18 as a minimum version.
Based on that, the only potentially "breaking" changes would be:
If you're importing and using ReactReduxContext, that export might go away depending on how we end up addressing the context compat question. (In that case, we'd likely end up providing some kind of getReactReduxContext() function as a replacement for that use case.)
If you're on React 16-17, you'd need to upgrade to React 18 to use React-Redux v9
But other than that, this ought to be a simple "bump the version and move on" upgrade.
The text was updated successfully, but these errors were encountered:
We're currently working on major versions for all of the Redux-related packages: RTK 2.0, Redux core 5.0, Reselect 5.0, and Redux-Thunk 3.0.
The primary driver for this is updating package formats for full ESM/CJS compatibility, as well as modernizing JS output.
I originally was not planning to publish a new major for React-Redux. It's been pretty stable ever since we released v8, with only a few minor TS types tweaks.
HOWEVER, we've decided it's worth doing a new major version after all.
One motivation is to address potential compat issues with React Server Components. Specifically, it seems that just calling
React.createContext()
in an RSC environment throws errors. React-Redux exports theReactReduxContext
singleton instance, and it's created on initialization as soon as you import from the package. This means importing one of our hooks throws an error inside of RSCs, and RTK Query's React-usingcreateApi
method tries to generate hooks.We've got an idea for working around that ( see #2025 ), but it's probably still worth coming up with a fuller solution.
Additionally, it is worth doing the same ESM/CJS packaging changes we've done in our other libraries.
Finally, React 18 has been out for a year. When we shipped v8, we defaulted to using the
useSyncExternalStore
"shim" package for compatibility with React 16-17. The shim adds some extra bytes to all consumers, even if you're using React 18. We can swap that now to only use the actualuSES
hook, and require React 18 as a minimum version.Based on that, the only potentially "breaking" changes would be:
ReactReduxContext
, that export might go away depending on how we end up addressing the context compat question. (In that case, we'd likely end up providing some kind ofgetReactReduxContext()
function as a replacement for that use case.)But other than that, this ought to be a simple "bump the version and move on" upgrade.
The text was updated successfully, but these errors were encountered: