Skip to content
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

[Snyk] Upgrade react-redux from 7.2.1 to 8.0.2 #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

contentstack-admin
Copy link
Contributor

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade react-redux from 7.2.1 to 8.0.2.

merge advice
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


Warning: This is a major version upgrade, and may be a breaking change.

  • The recommended version is 19 versions ahead of your current version.
  • The recommended version was released 4 months ago, on 2022-05-22.
Release notes
Package name: react-redux
  • 8.0.2 - 2022-05-22

    This patch release tweaks the behavior of connect to print a one-time warning when the obsolete pure option is passed in, rather than throwing an error. This fixes crashes caused by libraries such as react-beautiful-dnd continuing to pass in that option (unnecessarily) to React-Redux v8.

    What's Changed

    • Show warning instead of throwing error that pure option has been removed by @ ApacheEx in #1922

    Full Changelog: v8.0.1...v8.0.2

  • 8.0.1 - 2022-04-20

    This release fixes an incorrect internal import of our Subscription type, which was causing TS compilation errors in some user projects. We've also listed @ types/react-dom as an optional peerDep. There are no runtime changes in this release.

    What's Changed

    • Add optional peer dependency on @ types/react-dom by @ Methuselah96 in #1904
    • fix(ts): incorrect import of Subscription causes noImplicitAny error by @ vicrep in #1910

    Full Changelog: v8.0.0...v8.0.1

  • 8.0.0 - 2022-04-16
    Read more
  • 8.0.0-rc.1 - 2022-04-13

    This release candidate updates our peer deps to accept all React versions with hooks (16.8+, 17+, and 18+), as well as React Native (0.59+). (The code already worked, but the peer deps needed to be updated to match behavior and install correctly.)

    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! Barring any reported issues, we plan to release 8.0 as final within the next few days.

    What's Changed

    Full Changelog: v8.0.0-rc.0...v8.0.0-rc.1

  • 8.0.0-rc.0 - 2022-04-10

    This release candidate removes the DefaultRootState type left over from the @ types/react-redux package. Additionally, we now have tests that exercise the serverState SSR behavior added in a previous beta.

    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! Barring any reported issues, we plan to release 8.0 as final within the next few days.

    Changelog

    Removal of the DefaultRootState type

    The @ types/react-redux package, which has always been maintained by the community, included a DefaultRootState interface that was intended for use with TS's "module augmentation" capability. Both connect and useSelector used this as a fallback if no state generic was provided. When we migrated React-Redux to TS, we copied over all of the types from that package as a starting point.

    However, the Redux team specifically considers use of a globally augmented state type to be an anti-pattern. Instead, we direct users to extract the RootState and AppDispatch types from the store setup, and create pre-typed versions of the React-Redux hooks for use in the app.

    Now that React-Redux itself is written in TS, we've opted to remove the DefaultRootState type entirely. State generics now default to unknown instead.

    Technically the module augmentation approach can still be done in userland, but we discourage this practice.

    SSR Tests

    We added a serverState prop to <Provider> in beta.2 to resolve hydration mismatch issues, but had only done some quick hands-on testing locally. We now have tests that cover that use case.

    What's Changed

    Full Changelog: v8.0.0-beta.4...v8.0.0-rc.0

  • 8.0.0-beta.4 - 2022-04-02

    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 the uSES "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 imports useSyncExternalStore from React, with no shim. You can alias "react-redux": "react-redux/next" in your bundler to use that instead.

    What's Changed

    Full Changelog: v8.0.0-beta.3...v8.0.0-beta.4

  • 8.0.0-beta.3 - 2022-02-06

    This beta release fixes a regression with unsubscribe performance in useSelector, and does some minor internal cleanup in connect.

    At this point, React-Redux v8 is likely 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.

    The tentative plan is to do a final review of the code and behavior after React 18 goes final, then release React-Redux v8 final shortly after that.

    Changelog

    useSelector Unsubscribe Performance

    In 2019, we fixed a a reported issue with useSelector unsubscriptions showing quadratic performance, due to use of a single listeners array in our Subscription class. The fix was to switch to using a linked list to track subscribers.

    When we reworked useSelector to use useSyncExternalStore for v8, we passed store.subscribe directly and stopped subscribing via a Subscription instance, thinking that we might no longer need Subscription any more. However, Subscription is still used by <Provider>, so it won't be removed from the bundle anyway, and the switch to using store.subscribe regressed the unsubscription performance because it does still use a listeners array as well.

    We've switched back to having useSelector subscribe to the Subscription instance from <Provider>, and verified that this re-resolves the unsubscription performance behavior. We've also added a perf test to ensure that we capture this intended behavior and don't accidentally regress on this again in the future.

    Internal Cleanup

    We've removed a couple additional references to the removed pure option in connect, and tweaked some of the types to remove a legacy signature for Provider that is no longer relevant.

    What's Changed

    • test: Adjust type tests to be compatible with React 18 typings by @ eps1lon in #1868
    • Switch back to Subscription in useSelector to fix unsubscribe perf by @ markerikson in #1870
    • Cleanup more code after pure removal by @ Andarist in #1859

    Full Changelog: v8.0.0-beta.2...v8.0.0-beta.3

  • 8.0.0-beta.2 - 2021-12-22

    This beta release makes several fixes to the TypeScript types for v8, fixes several dev dependencies that were accidentally listed as dependencies, and adds initial React 18 SSR support.

    Changelog

    TypeScript Fixes

    The initial TS conversion effort ported a chunk of the typetests from the React-Redux v7 types in DefinitelyTyped. We've ported over the remainder of the typetests, which uncovered a few bugs and missing types (such as the useStore hook not being generic).

    Those issues are now fixed, and after some additional tweaks all of the typetests are now passing. This means that existing TS usage of React-Redux v7 should be able to work entirely as-is with v8.

    React 18 SSR Support

    The new React 18 useSyncExternalStore hook accepts a function to supply the current state when called, which is normally the Redux store.getState method. However, a mutable store like Redux could change before or during an initial hydration render (such as a manual store.dispatch() before calling hydrateRoot(), or React components dispatching actions during the mount process). To avoid that, useSyncExternalStore also requires that you provide a getServerSnapshot function that can return a consistent single state value. uSES will use that all the way through the initial hydration render, and then check to see if any further updates are needed based on the latest state after the hydration render is complete.

    The Provider component now accepts an optional serverState prop. If you're doing SSR, serialize your Redux store state on the server and pass that in to Provider as <Provider store={store} serverState={window.initialServerState}>, similar to how you would initialize a Redux store with that value.

    We've updated both useSelector and connect to use the serverState value if it exists and pass that to useSyncExternalStore. This has been only briefly tested so far, but it appears to correctly eliminate hydration mismatch warnings.

    We would really like more users to try this out and give us feedback!

    Huge thanks to @ Ephem for providing an SSR example to work with, and @ acdlite for the API idea.

    Dependency Updates

    React-Redux now expects React 18 RC as a peer dep.

    Several test libraries were accidentally added as dependencies in the previous betas, so they would get installed in user projects as well. Those have been moved back to devDependencies as intended.

    What's Changed

    Full Changelog: v8.0.0-beta.1...v8.0.0-beta.2

  • 8.0.0-beta.1 - 2021-11-20
  • 8.0.0-beta.0 - 2021-11-19
  • 8.0.0-alpha.1 - 2021-11-02
  • 8.0.0-alpha.0 - 2021-10-03
  • 7.2.8 - 2022-04-01
    Read more
  • 7.2.7 - 2022-03-31
    Read more
  • 7.2.6 - 2021-10-25
  • 7.2.5 - 2021-09-04
  • 7.2.4 - 2021-04-24
  • 7.2.3 - 2021-03-23
  • 7.2.2 - 2020-10-26
  • 7.2.1 - 2020-07-25
from react-redux GitHub release notes
Commit messages
Package name: react-redux
  • a2853bc Merge pull request #1922 from ApacheEx/feature/pure-option-warning
  • 6e219ee show warning instead of throwing error that pure option has been removed
  • 8e39fa6 Merge pull request #1919 from aroyan/patch-1
  • dc919fd fix(docs): update broken link
  • f54f918 Release 8.0.1
  • 7b6270d fix(ts): incorrect import of `Subscription` causes TS error (#1910)
  • 26ddc6a remove unused import (#1908)
  • 709c10e Merge pull request #1905 from phapdinh/issues/1302
  • 15e8747 add note for mergeProps
  • ee81e96 Add optional peer dependency on @ types/react-dom (#1904)
  • 81203e6 Release 8.0.0
  • d9464a7 Merge pull request #1902 from reduxjs/docs/v8-docs-updates
  • 885c1cc Update docs for v8 final
  • 1da5216 Merge pull request #1897 from reduxjs/bugfix/v8-merge-dispatchprop
  • 7765805 Port DT fix for `dispatchProp` arg in `mergeProps`
  • 80fc518 Release 8.0.0-rc.1
  • d771e26 Merge pull request #1895 from reduxjs/feature/v8-peerdeps
  • db94ad0 Widen React peer deps and add optional Redux dep for types
  • 6aefb35 Remove leftover `.only`
  • bf7f9b6 Merge pull request #1893 from kyletsang/fix-peerdeps
  • 3ba3d7a fix(deps): add optional peer deps into `peerDependencies`
  • f3441c6 Merge pull request #1891 from Methuselah96/merge-props
  • 19cc9e4 Remove ts-ignore for initMergeProps
  • e00d8af Release 8.0.0-rc.0

Compare


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

@contentstack-admin contentstack-admin requested a review from a team as a code owner September 16, 2022 09:33
@contentstack-admin contentstack-admin requested a review from a team September 16, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants