ral-facilities / scigateway

SciGateway is the parent application for several plugins providing access to data and compute tools for large Science Facilities
Apache License 2.0
6 stars 4 forks source link

Update dependency redux-thunk to v3 #1365

Closed renovate[bot] closed 6 months ago

renovate[bot] commented 7 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
redux-thunk 2.4.1 -> 3.1.0 age adoption passing confidence

Release Notes

reduxjs/redux-thunk (redux-thunk) ### [`v3.1.0`](https://togithub.com/reduxjs/redux-thunk/releases/tag/v3.1.0) [Compare Source](https://togithub.com/reduxjs/redux-thunk/compare/v3.0.1...v3.1.0) This **major release**: - Updates the packaging for better ESM/CJS compatibility - Changes the package to use named exports instead of a default export This release has **breaking changes**. (Note: this actually points to v3.1.0, which includes a hotfix that was meant for 3.0.0.) This release is part of a wave of major versions of all the Redux packages: **Redux Toolkit 2.0, Redux core 5.0, React-Redux 9.0, Reselect 5.0, and Redux Thunk 3.0**. For full details on all of the breaking changes and other significant changes to all of those packages, see the **["Migrating to RTK 2.0 and Redux 5.0" migration guide](https://redux.js.org/usage/migrations/migrating-rtk-2)** in the Redux docs. > \[!NOTE] > The Redux core, Reselect, and Redux Thunk packages are included as part of Redux Toolkit, and RTK users do not need to manually upgrade them - you'll get them as part of the upgrade to RTK 2.0. (If you're not using Redux Toolkit yet, [**please start migrating your existing legacy Redux code to use Redux Toolkit today!**](https://redux.js.org/usage/migrating-to-modern-redux)) ```bash ### RTK npm install @​reduxjs/toolkit yarn add @​reduxjs/toolkit ### Standalone npm install redux-thunk yarn add redux-thunk ``` #### Changelog ##### Named Exports Instead of Default Exports The `redux-thunk` package previously used a single default export that was the thunk middleware, with an attached field named `withExtraArgument` that allowed customization. **The default export has been removed. There are now two named exports: `thunk` (the basic middleware) and `withExtraArgument`.** If you are using Redux Toolkit, this should have no effect, as RTK already handles this inside of `configureStore`. ##### 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. **The primary build artifact is now an ESM file, `dist/redux-thunk.mjs`**. Most build tools should pick this up. There's also a CJS artifact, and a second copy of the ESM file named `redux-thunk.legacy-esm.js` to support Webpack 4 (which does not recognize the `exports` field in `package.json`). ##### Build Tooling We're now building the package using https://github.com/egoist/tsup. We also now include sourcemaps for the ESM and CJS artifacts. The repo has been updated to use Yarn 3 for dependencies and Vitest for running tests. ##### 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. Since the code is so simple, the ESM artifact can be used directly in the browser via Unpkg. If you have strong use cases for us continuing to include UMD build artifacts, please let us know! ##### `extend-redux` Typedefs Removed Redux Thunk 2.x included a `redux-thunk/extend-redux` TS-only entry point, which extended the types of `dispatch` and `bindActionCreators` to globally give them knowledge of the thunk types. We feel that global overrides from a library are an anti-pattern, and we've removed this entry point. (*Note*: this ended up being released in 3.1.0, as it was missed in the original 3.0.0 release.) Please follow our [TS setup guidelines](https://redux.js.org/tutorials/typescript-quick-start#define-root-state-and-dispatch-types) to infer the correct type of `dispatch` for your store. #### What's Changed - Migrate thunk package to ESM by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/340](https://togithub.com/reduxjs/redux-thunk/pull/340) - Switch package manager to Yarn 3 and update CI jobs by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/341](https://togithub.com/reduxjs/redux-thunk/pull/341) - Run RTK publish CI examples on built artifact by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/342](https://togithub.com/reduxjs/redux-thunk/pull/342) - Rewrite build/test setup and hopefully fix ESM compat by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/344](https://togithub.com/reduxjs/redux-thunk/pull/344) - Change artifact names to be `redux-thunk` by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/345](https://togithub.com/reduxjs/redux-thunk/pull/345) - Support Webpack 4 with a "legacy ESM" artifact by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/346](https://togithub.com/reduxjs/redux-thunk/pull/346) - update README and types to match named export by [@​EskiMojo14](https://togithub.com/EskiMojo14) in [https://github.com/reduxjs/redux-thunk/pull/347](https://togithub.com/reduxjs/redux-thunk/pull/347) - Bump Redux peer dep for RC and update build tooling by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/356](https://togithub.com/reduxjs/redux-thunk/pull/356) - Drop the extend-redux addition by [@​markerikson](https://togithub.com/markerikson) in [https://github.com/reduxjs/redux-thunk/pull/357](https://togithub.com/reduxjs/redux-thunk/pull/357) **Full Changelog**: https://github.com/reduxjs/redux-thunk/compare/v2.4.2...v3.1.0 ### [`v3.0.1`](https://togithub.com/reduxjs/redux-thunk/compare/v3.0.0...v3.0.1) [Compare Source](https://togithub.com/reduxjs/redux-thunk/compare/v3.0.0...v3.0.1) ### [`v3.0.0`](https://togithub.com/reduxjs/redux-thunk/compare/v2.4.2...v3.0.0) [Compare Source](https://togithub.com/reduxjs/redux-thunk/compare/v2.4.2...v3.0.0) ### [`v2.4.2`](https://togithub.com/reduxjs/redux-thunk/releases/tag/v2.4.2) [Compare Source](https://togithub.com/reduxjs/redux-thunk/compare/v2.4.1...v2.4.2) This release removes an unused TS type that caused errors when users were type-checking libraries in `node_modules`. #### What's Changed - Remove unused type by [@​antoniopresto](https://togithub.com/antoniopresto) in [https://github.com/reduxjs/redux-thunk/pull/328](https://togithub.com/reduxjs/redux-thunk/pull/328) **Full Changelog**: https://github.com/reduxjs/redux-thunk/compare/v2.4.1...v2.4.2

Configuration

📅 Schedule: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.78%. Comparing base (f3c08c0) to head (a080722).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1365 +/- ## ======================================== Coverage 96.78% 96.78% ======================================== Files 48 48 Lines 1740 1740 Branches 492 492 ======================================== Hits 1684 1684 Misses 52 52 Partials 4 4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

renovate[bot] commented 6 months ago

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

âš  Warning: custom changes will be lost.

kaperoo commented 6 months ago

Updated redux-thunk imports