v8.0.0-beta.4 #1885
markerikson
started this conversation in
General
v8.0.0-beta.4
#1885
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This beta release switches the default entry point to use the
useSyncExternalStore
shim for compatibility with React 16.8+, and switches to a/"next"
alternate entry point without the shim.At this point, React-Redux v8 is feature-complete and stable. We still really want users to try this out and give us feedback before the final release! We'd also like to add some additional tests around SSR behavior.
We would like to release v8 as final within the next couple weeks now that React 18 is available.
Changelog
`useSyncExternalStore Shim Usage
React 18 adds the new
useSyncExternalStore
API. In previous betas, the plan was that React-Redux v8 would have a hard requirement on React 18. As a fallback, the betas provided a"/compat"
entry point that included theuSES
"shim", a userland implementation from the React team that provided compatibility with earlier React versions back to 16.8. That adds a few hundred bytes to the bundle size, so we wanted to keep the default size smaller.However, React Native will not support React 18 until the "New Architecture" is done. So, release React-Redux v8 with a hard React 18 requirement would immediately start breaking RN usage.
After discussion with the React team, we've flipped the default behavior in v8. Now, the default entry point does rely on the
uSES
shim. This increases final bundle size slightly (about 600b minified compared to v7.x). However, this ensures that React-Redux v8 is compatible with React 16.8+/17 out of the box, enabling users to upgrade to v8 right away even if they aren't using React 18. It also ensures continued RN compatibility.For users who would like to strip out the shim, this release switches to having a
"/next"
entry point that directly importsuseSyncExternalStore
from React, with no shim. You can alias"react-redux": "react-redux/next"
in your bundler to use that instead.What's Changed
useSyncExternalStore
shim behavior and update React deps by @markerikson in SwapuseSyncExternalStore
shim behavior and update React deps #1884Full Changelog: v8.0.0-beta.3...v8.0.0-beta.4
This discussion was created from the release v8.0.0-beta.4.
Beta Was this translation helpful? Give feedback.
All reactions