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

fix(types): export ThunkWithReturnValue interface #3108

Merged
merged 1 commit into from
Jan 28, 2023
Merged

fix(types): export ThunkWithReturnValue interface #3108

merged 1 commit into from
Jan 28, 2023

Conversation

giomogna
Copy link
Contributor

Closes #3107

Export ThunkWithReturnValue interface to fix errors like the one below when trying to emit declarations of api types.

Exported variable 'authApi' has or is using name 'ThunkWithReturnValue' from external module "/node_modules/@reduxjs/toolkit/dist/query/core/module" but cannot be named.

@codesandbox
Copy link

codesandbox bot commented Jan 20, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Jan 20, 2023

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit db1873d
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/63cab49c4a223e00089336d1
😎 Deploy Preview https://deploy-preview-3108--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit db1873d:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration

@markerikson markerikson merged commit bd9c4ab into reduxjs:master Jan 28, 2023
jeanregisser referenced this pull request in valora-inc/wallet Feb 23, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@reduxjs/toolkit](https://redux-toolkit.js.org)
([source](https://togithub.com/reduxjs/redux-toolkit)) | [`^1.9.1` ->
`^1.9.2`](https://renovatebot.com/diffs/npm/@reduxjs%2ftoolkit/1.9.1/1.9.2)
|
[![age](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.9.2/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.9.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.9.2/compatibility-slim/1.9.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@reduxjs%2ftoolkit/1.9.2/confidence-slim/1.9.1)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>reduxjs/redux-toolkit</summary>

###
[`v1.9.2`](https://togithub.com/reduxjs/redux-toolkit/releases/tag/v1.9.2)

[Compare
Source](https://togithub.com/reduxjs/redux-toolkit/compare/v1.9.1...v1.9.2)

This bugfix release fixes a memory leak in `createListenerMiddleware`,
optimizes performance inside `serializableMiddleware`, adds new options
for `fetchBaseQuery`, adds support for path `RegExp` exclusions in
`serializableMiddleware` and `immutabilityMiddleware`, and improves some
TS types.

#### Changelog

##### Bug Fixes

`createListenerMiddleware` had a memory leak that turned out to be [due
to use of
`Promise.race()`](https://togithub.com/reduxjs/redux-toolkit/issues/3020).
We've restructured the logic to fix that.

`fetchBaseQuery` now correctly combines global options with endpoint /
default options in all cases.

##### New Options

`fetchBaseQuery` now supports a `jsonReplacer` option that will be used
when processing JSON.

Both dev check middleware now support regular expressions in the
`ignoredPaths` array in addition to strings. This adds extra flexibility
in skipping certain fields.

##### TS Changes

The `CaseReducer` type was sometimes incorrectly inferring its return
type in rare cases. That's been fixed.

The `isAnyOf/isAllOf` matcher function TS types have been tweaked to not
require an individual first parameter. This allows spreading arrays of
matchers as arguments, like `const isLoading =
isAnyOf(...interestingPendingThunksArray)`.

##### Other Changes

The `serializableMiddleware` now uses a `WeakSet` if available to cache
values it's seen. This should significantly speed up checks against
large state values in development builds.

#### What's Changed

- fix CaseReducer to infer from argument, not return value by
[@&#8203;phryneas](https://togithub.com/phryneas) in
[https://github.com/reduxjs/redux-toolkit/pull/3054](https://togithub.com/reduxjs/redux-toolkit/pull/3054)
- fetchBaseQuery | Add jsonReplacer param by
[@&#8203;tophep](https://togithub.com/tophep) in
[https://github.com/reduxjs/redux-toolkit/pull/2904](https://togithub.com/reduxjs/redux-toolkit/pull/2904)
- Support RegExp in ignoredPaths/ignoredActionPaths by
[@&#8203;markerikson](https://togithub.com/markerikson) in
[https://github.com/reduxjs/redux-toolkit/pull/3129](https://togithub.com/reduxjs/redux-toolkit/pull/3129)
- fix(types): export `ThunkWithReturnValue` interface by
[@&#8203;giomogna](https://togithub.com/giomogna) in
[https://github.com/reduxjs/redux-toolkit/pull/3108](https://togithub.com/reduxjs/redux-toolkit/pull/3108)
- remove unnecessary fetchBaseQuery defaults by
[@&#8203;phryneas](https://togithub.com/phryneas) in
[https://github.com/reduxjs/redux-toolkit/pull/3062](https://togithub.com/reduxjs/redux-toolkit/pull/3062)
- make isAnyOf friendly for mapped matchers, but making argument
optional by [@&#8203;megagon](https://togithub.com/megagon) in
[https://github.com/reduxjs/redux-toolkit/pull/3123](https://togithub.com/reduxjs/redux-toolkit/pull/3123)
- `raceWithSignal` method instead of `Promise.race` by
[@&#8203;phryneas](https://togithub.com/phryneas) in
[https://github.com/reduxjs/redux-toolkit/pull/3021](https://togithub.com/reduxjs/redux-toolkit/pull/3021)
- Fix lint problems and enable linting on CI by
[@&#8203;thorn0](https://togithub.com/thorn0) in
[https://github.com/reduxjs/redux-toolkit/pull/2992](https://togithub.com/reduxjs/redux-toolkit/pull/2992)
- Add caching to serializableStateInvariantMiddleware by
[@&#8203;GeorchW](https://togithub.com/GeorchW) in
[https://github.com/reduxjs/redux-toolkit/pull/3115](https://togithub.com/reduxjs/redux-toolkit/pull/3115)
- Allow TS isolatedModules flag to be set for safer transpilation by
[@&#8203;matmannion](https://togithub.com/matmannion) in
[https://github.com/reduxjs/redux-toolkit/pull/2911](https://togithub.com/reduxjs/redux-toolkit/pull/2911)

**Full Changelog**:
reduxjs/redux-toolkit@v1.9.1...v1.9.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
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.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDguMCIsInVwZGF0ZWRJblZlciI6IjM0LjE0OC4wIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
thoomasbro added a commit to MTES-MCT/monitorenv that referenced this pull request Jun 7, 2023
<h3>Snyk has created this PR to upgrade @reduxjs/toolkit from 1.8.2 to
1.9.5.</h3>

:information_source: 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.
<hr/>

- The recommended version is **16 versions** ahead of your current
version.
- The recommended version was released **2 months ago**, on 2023-04-18.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>@reduxjs/toolkit</b></summary>
    <ul>
      <li>
<b>1.9.5</b> - <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.5">2023-04-18</a></br><p>This
bugfix release includes notable improvements to TS type inference when
using the <code>enhancers</code> option in <code>configureStore</code>,
and updates the listener middleware to only check predicates if the
dispatched value is truly an action object.</p>
<h2>What's Changed</h2>
<ul>
<li>update to latest remark-typescript-tools by <a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/EskiMojo14/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/EskiMojo14">@ EskiMojo14</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1647245026" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3311"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3311/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3311">#3311</a></li>
<li>add isAction helper function, and ensure listener middleware only
runs for actions by <a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/EskiMojo14/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/EskiMojo14">@ EskiMojo14</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1671543278" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3372"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3372/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3372">#3372</a></li>
<li>Allow inference of enhancer state extensions, and fix inference when
using callback form by <a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/EskiMojo14/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/EskiMojo14">@ EskiMojo14</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1599279846" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3207"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3207/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3207">#3207</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/compare/v1.9.4...v1.9.5"><tt>v1.9.4...v1.9.5</tt></a></p>
      </li>
      <li>
<b>1.9.4</b> - <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.4">2023-04-17</a></br><p>This
bugfix release includes tweaks to RTKQ options handling, tweaks for perf
updates, dependency updates, and updates to our CI tooling.</p>
<p>Also, please check out our ongoing RTK 2.0 alpha releases! They have
significant improvements to bundle size, ESM/CJS compatibility, TS
typings, and reducer update performance. We're looking for real-world
feedback on behavior, performance, and any issues you might run
into.</p>
<h2>Changelog</h2>
<h3>RTK Query Options Updates</h3>
<p>Passing <code>transformResponse</code> as part of
<code>enhanceEndpoints</code> can now override the TS type of the
original data.</p>
<p><code>fetchBaseQuery</code> now properly checks for a global
<code>responseHandler</code> option.</p>
<h3>Performance and Internals</h3>
<p>RTK Query now uses Immer's <code>original()</code> to do comparisons
inside of <code>copyWithStructuralSharing</code>, which should
significantly speed up performance when applying changes from re-fetched
data.</p>
<p>RTKQ's internal <code>subscriptionUpdated</code> action is now marked
as batchable.</p>
<p>We've updated dependencies to Immer 9.0.21, Reselect 4.1.8, and Redux
4.2.1.</p>
<h3>CI Updates</h3>
<p>We've added a suite of example apps built with different frameworks
such as CRA 4, CRA 5, Next, and Vite, as well as examples that check for
compatibility in Node with CJS and ESM modes and with various TS module
resolution modes.</p>
<h2>What's Changed</h2>
<ul>
<li>Test published artifacts in CI by <a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1599795072" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3213"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3213/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3213">#3213</a></li>
<li>Use Git revision in version and add Node CI examples by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1620519241" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3258"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3258/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3258">#3258</a></li>
<li>Add <code>arethetypeswrong</code> automated CLI check by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1640614710" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3294"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3294/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3294">#3294</a></li>
<li>Add <code>attw</code> CLI option to treat problems as non-errors by
<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1651028883" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3316"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3316/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3316">#3316</a></li>
<li>Use original instead of immer draft for perf by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/GeorchW/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/GeorchW">@ GeorchW</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1625420397" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3270"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3270/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3270">#3270</a></li>
<li>enable enhanceEndpoints.transformResponse to override ResultType by
<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/dmitrigrabov/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/dmitrigrabov">@ dmitrigrabov</a>
in <a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1465453759" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#2953"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/2953/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/2953">#2953</a></li>
<li>Fix global <code>responseHandler</code> being used in
<code>fetchBaseQuery</code> by <a class="user-mention notranslate"
data-hovercard-type="user" data-hovercard-url="/users/praxxis/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/praxxis">@ praxxis</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1562715953" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3137"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3137/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3137">#3137</a></li>
<li>reset internalState.currentSubscriptions on
<code>resetApiState</code> by <a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/phryneas/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/phryneas">@ phryneas</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1658730665" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3333"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3333/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3333">#3333</a></li>
<li>Bump deps and mark <code>subscriptionUpdated</code> as autobatched
by <a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1670234827" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3364"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3364/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3364">#3364</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/compare/v1.9.3...v1.9.4"><tt>v1.9.3...v1.9.4</tt></a></p>
      </li>
      <li>
<b>1.9.3</b> - <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.3">2023-02-21</a></br><p>This
release fixes a couple issues with the <code>skip/skipToken</code>
options for query hooks, and makes a small perf tweak to serializing
query args.</p>
<h2>Changelog</h2>
<h3>Skip Behavior</h3>
<p>We made a change in <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.0">v1.9.0</a>
that tried to make some skip behavior more consistent, including
clearing out the cached data. However, we had overlooked that our own
docs actually said "skipping a query will <em>keep</em> the cached
data", and several users pointed this out as they'd been relying on that
behavior.</p>
<p>We've reverted that change. Now, setting <code>{skip: true}</code> or
<code>skipToken</code> for a query with existing results will keep the
<code>data</code> value (reflecting the last successful query), but
<code>currentData</code> will be undefined (reflecting the
<em>current</em> settings).</p>
<p>We also identified and fixed an issue that could cause subscription
entries to leak under a specific combination of timing and settings
changes.</p>
<h3>Query Arg Serialization Perf</h3>
<p>RTKQ relies on serializing query arguments to serve as the cache
keys, with the default using <code>JSON.stringify()</code> + some logic
for sorting keys. There was a report that in some apps, large query arg
objects could take a while to stringify and this was being done
repeatedly. We've added a <code>WeakMap</code>-based cache for query
args to avoid re-serializing existing arg values.</p>
<h2>What's Changed</h2>
<ul>
<li>Revert "clear data on skip" back to its original behavior by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1590791931" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3188"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3188/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3188">#3188</a></li>
<li>Use a WeakMap cache for query arg serialization for perf by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1592238985" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3193"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3193/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3193">#3193</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/compare/v1.9.2...v1.9.3"><tt>v1.9.2...v1.9.3</tt></a></p>
      </li>
      <li>
<b>1.9.2</b> - <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.2">2023-01-28</a></br><p>This
bugfix release fixes a memory leak in
<code>createListenerMiddleware</code>, optimizes performance inside
<code>serializableMiddleware</code>, adds new options for
<code>fetchBaseQuery</code>, adds support for path <code>RegExp</code>
exclusions in <code>serializableMiddleware</code> and
<code>immutabilityMiddleware</code>, and improves some TS types.</p>
<h2>Changelog</h2>
<h3>Bug Fixes</h3>
<p><code>createListenerMiddleware</code> had a memory leak that turned
out to be <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/issues/3020"
data-hovercard-type="issue"
data-hovercard-url="/reduxjs/redux-toolkit/issues/3020/hovercard">due to
use of <code>Promise.race()</code></a>. We've restructured the logic to
fix that.</p>
<p><code>fetchBaseQuery</code> now correctly combines global options
with endpoint / default options in all cases.</p>
<h3>New Options</h3>
<p><code>fetchBaseQuery</code> now supports a <code>jsonReplacer</code>
option that will be used when processing JSON.</p>
<p>Both dev check middleware now support regular expressions in the
<code>ignoredPaths</code> array in addition to strings. This adds extra
flexibility in skipping certain fields.</p>
<h3>TS Changes</h3>
<p>The <code>CaseReducer</code> type was sometimes incorrectly inferring
its return type in rare cases. That's been fixed.</p>
<p>The <code>isAnyOf/isAllOf</code> matcher function TS types have been
tweaked to not require an individual first parameter. This allows
spreading arrays of matchers as arguments, like <code>const isLoading =
isAnyOf(...interestingPendingThunksArray)</code>.</p>
<h3>Other Changes</h3>
<p>The <code>serializableMiddleware</code> now uses a
<code>WeakSet</code> if available to cache values it's seen. This should
significantly speed up checks against large state values in development
builds.</p>
<h2>What's Changed</h2>
<ul>
<li>fix CaseReducer to infer from argument, not return value by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/phryneas/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/phryneas">@ phryneas</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1516765916" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3054"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3054/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3054">#3054</a></li>
<li>fetchBaseQuery | Add jsonReplacer param by <a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/tophep/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/tophep">@ tophep</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1447193004" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#2904"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/2904/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/2904">#2904</a></li>
<li>Support RegExp in ignoredPaths/ignoredActionPaths by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/markerikson/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/markerikson">@ markerikson</a> in
<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1560956346" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3129"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3129/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3129">#3129</a></li>
<li>fix(types): export <code>ThunkWithReturnValue</code> interface by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/giomogna/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/giomogna">@ giomogna</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1551057034" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3108"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3108/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3108">#3108</a></li>
<li>remove unnecessary fetchBaseQuery defaults by <a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/phryneas/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/phryneas">@ phryneas</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1522739516" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3062"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3062/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3062">#3062</a></li>
<li>make isAnyOf friendly for mapped matchers, but making argument
optional by <a class="user-mention notranslate"
data-hovercard-type="user" data-hovercard-url="/users/megagon/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/megagon">@ megagon</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1558085622" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3123"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3123/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3123">#3123</a></li>
<li><code>raceWithSignal</code> method instead of
<code>Promise.race</code> by <a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/phryneas/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/phryneas">@ phryneas</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1504902319" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3021"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3021/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3021">#3021</a></li>
<li>Fix lint problems and enable linting on CI by <a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/thorn0/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/thorn0">@ thorn0</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1488424615" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#2992"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/2992/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/2992">#2992</a></li>
<li>Add caching to serializableStateInvariantMiddleware by <a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/GeorchW/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/GeorchW">@ GeorchW</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1553397570" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#3115"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/3115/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/3115">#3115</a></li>
<li>Allow TS isolatedModules flag to be set for safer transpilation by
<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/matmannion/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/matmannion">@ matmannion</a> in <a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1449638690" data-permission-text="Title is private"
data-url="reduxjs/redux-toolkit#2911"
data-hovercard-type="pull_request"
data-hovercard-url="/reduxjs/redux-toolkit/pull/2911/hovercard"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/pull/2911">#2911</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link"
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/compare/v1.9.1...v1.9.2"><tt>v1.9.1...v1.9.2</tt></a></p>
      </li>
      <li>
<b>1.9.1</b> - <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.1">2022-11-30</a></br><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases/tag/v1.9.1">
Read more </a>
      </li>
      <li>
        <b>1.9.0</b> - 2022-11-04
      </li>
      <li>
        <b>1.9.0-rc.1</b> - 2022-11-02
      </li>
      <li>
        <b>1.9.0-rc.0</b> - 2022-10-30
      </li>
      <li>
        <b>1.9.0-beta.0</b> - 2022-10-19
      </li>
      <li>
        <b>1.9.0-alpha.2</b> - 2022-10-09
      </li>
      <li>
        <b>1.9.0-alpha.1</b> - 2022-08-28
      </li>
      <li>
        <b>1.9.0-alpha.0</b> - 2022-08-19
      </li>
      <li>
        <b>1.8.6</b> - 2022-10-09
      </li>
      <li>
        <b>1.8.5</b> - 2022-08-19
      </li>
      <li>
        <b>1.8.4</b> - 2022-08-11
      </li>
      <li>
        <b>1.8.3</b> - 2022-06-30
      </li>
      <li>
        <b>1.8.2</b> - 2022-05-25
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/releases">@reduxjs/toolkit
GitHub release notes</a>
  </details>
</details>


<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>@reduxjs/toolkit</b></summary>
    <ul>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/1f87ac2071d020212070075f5a44db683bd3e5d5">1f87ac2</a>
Merge pull request #3207 from EskiMojo14/enhancer-array</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/da3f6ed4aaf1336604d916d4be3e73f1ae84ec65">da3f6ed</a>
Merge pull request #3372 from EskiMojo14/listener-action</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/ebe1777f2975ab50384da08cca5e0ba629460749">ebe1777</a>
Merge pull request #3311 from EskiMojo14/remark-typescript-update</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/0c6cd6eb17e87f6495cf6442e6a68f08c5d9e813">0c6cd6e</a>
add test</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/482270e6aa6db7a2b1449bcf26b40f2a9979eac3">482270e</a>
add isAction helper function, and ensure listener middleware only runs
for actions</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/eb586b65aa93405486311a6eb188b4fc8bea0c1b">eb586b6</a>
Merge pull request #3366 from n-ii-ma/patch-1</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/811dd473ad8180d65a73255342069a55da037ac2">811dd47</a>
Fix typo</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/18bc6bc999593356274bf9b70bfff6a70e1bffd1">18bc6bc</a>
Release 1.9.4</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/2282f608fe3459b971b8171dfac27c2f6e33c0b0">2282f60</a>
Merge pull request #3364 from reduxjs/bugfix/autobatch-actions</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/a9057c6bb6a51a5582824ce1dc083512f99ea417">a9057c6</a>
Mark &#x60;subscriptionsUpdated&#x60; as autobatched</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/cc9d4165394d29f7acdafbdb54dc1e1087f61e59">cc9d416</a>
Merge pull request #3333 from reduxjs/pr/fix-3119</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/ef8480b9ed746bd9fa5d98b45426e6b07eb78127">ef8480b</a>
Bump deps</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/8232827c667e33b334577c226fdc7e058bbdd6aa">8232827</a>
Merge pull request #3137 from praxxis/global-responsehandler</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/8962cef6bee654812cf42b1c4252a065863d13e7">8962cef</a>
Merge pull request #2953 from
dmitrigrabov/use-transformed-response-result-type</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/53df220b374ae83a1bbdad40101ebaffb5f87e64">53df220</a>
Merge pull request #3270 from
GeorchW/copywithstructuralsharing-perf</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/933502ce276dc1fca6cfdb92d2b645b77a94e4d3">933502c</a>
Use original instead of immer draft for perf</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/23a78cabae33ffc514602e9ea5763446db02e1b6">23a78ca</a>
Merge pull request #3334 from chmac/patch-2</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/b9c3ef43b70d5a94964cacfa268611b6e367ba87">b9c3ef4</a>
Add a note about timing #2435</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/ab485012bfca753236b5533ce7651b6baf4ffbaa">ab48501</a>
Merge pull request #3331 from chmac/patch-1</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/25717186fb25cae0cb51770d6f4f14d66a08e604">2571718</a>
Minor typo fix</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/98d7dda57992ccd20b93eaf85bcf35ac802b0b3f">98d7dda</a>
reset internalState.currentSubscriptions on
&#x60;resetApiState&#x60;</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/91ea926cd53f5bf0a9da14d7bdcb127dcd71c8d2">91ea926</a>
Merge pull request #3316 from reduxjs/feature/attw-args</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/a058d8d60fff420c17e7a03e4b132d9068633f83">a058d8d</a>
Add CLI flag to treat ATTW problems as non-errors</li>
<li><a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/commit/1c7a705180fc20913468d191e1705097a1423589">1c7a705</a>
Add yargs</li>
    </ul>

<a
href="https://snyk.io/redirect/github/reduxjs/redux-toolkit/compare/3d7bd2246df35a668a25d60a757f1f0b6df62798...1f87ac2071d020212070075f5a44db683bd3e5d5">Compare</a>
  </details>
</details>
<hr/>

**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: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI3MDcyMDc0Yy05YTczLTQ1OTItODIzOC04MmNmMDEyNDlkNmMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjcwNzIwNzRjLTlhNzMtNDU5Mi04MjM4LTgyY2YwMTI0OWQ2YyJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/mtes-mct/project/afb3e19a-88e3-4a0e-9409-d0f9cfdc75b5?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/mtes-mct/project/afb3e19a-88e3-4a0e-9409-d0f9cfdc75b5/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/mtes-mct/project/afb3e19a-88e3-4a0e-9409-d0f9cfdc75b5/settings/integration?pkg&#x3D;@reduxjs/toolkit&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"7072074c-9a73-4592-8238-82cf01249d6c","prPublicId":"7072074c-9a73-4592-8238-82cf01249d6c","dependencies":[{"name":"@reduxjs/toolkit","from":"1.8.2","to":"1.9.5"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/mtes-mct/project/afb3e19a-88e3-4a0e-9409-d0f9cfdc75b5?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"afb3e19a-88e3-4a0e-9409-d0f9cfdc75b5","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":16,"publishedDate":"2023-04-18T02:47:17.131Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]})
--->
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.

ThunkWithReturnValue not exported
2 participants