This feature release adds a new RTK Query upsertQueryEntries util to batch-upsert cache entries more efficiently, passes through additional values for use in prepareHeaders, and exports additional TS types around query options and selectors.
Changelog
upsertQueryEntries
RTK Query already had an upsertQueryData thunk that would upsert a single cache entry. However, some users wanted to upsert many cache entries (potentially hundreds or thousands), and found that upsertQueryData had poor performance in those cases. This is because upsertQueryData runs the full async request handling sequence, including dispatching both pending and fulfilled actions, each of which run the main reducer and update store subscribers. That means there's 2N store / UI updates per item, so upserting hundreds of items becomes extremely perf-intensive.
RTK Query now includes an api.util.upsertQueryEntries action that is meant to handle the batched upsert use case more efficiently. It's a single synchronous action that accepts an array of many {endpointName, arg, value} entries to upsert. This results in a single store update, making this vastly better for performance vs many individual upsertQueryData calls.
We see this as having two main use cases. The first is prefilling the cache with data retrieved from storage on app startup (and it's worth noting that upsertQueryEntries can accept entries for many different endpoints as part of the same array).
The second is to act as a "pseudo-normalization" tool. RTK Query is not a "normalized" cache. However, there are times when you may want to prefill other cache entries with the contents of another endpoint, such as taking the results of a getPosts list endpoint response and prefilling the individual getPost(id) endpoint cache entries, so that components that reference an individual item endpoint already have that data available.
Currently, you can implement the "pseudo-normalization" approach by dispatching upsertQueryEntries in an endpoint lifecycle, like this:
// Pre-fill the individual post entries with the results
// from the list endpoint query
dispatch(
api.util.upsertQueryEntries(
posts.map((post) => ({
endpointName: 'getPost',
arg: { id: post.id },
value: post,
})),
),
)
},
}),
getPost: build.query<Post, Pick<Post, 'id'>>({
query: (post) => `post/${post.id}`,
}),
}),
})
Down the road we may add a new option to query endpoints that would let you provide the mapping function and have it automatically update the corresponding entries.
Relevant for users of the @sentry/nextjs package: If you have previously configured a
SENTRY_IGNORE_API_RESOLUTION_ERROR environment variable, it is now safe to unset it.
Other Changes
feat(cdn): Export getReplay in replay CDN bundles
(#13881)
feat(replay): Clear fallback buffer when switching buffers
(#13914)
feat(replay): Upgrade rrweb packages to 2.28.0 (#13732)
fix(docs): Correct supported browsers due to globalThis
(#13788)
fix(nextjs): Adjust path to requestAsyncStorageShim.js template file
(#13928)
fix(nextjs): Detect new locations for request async storage to support Next.js v15.0.0-canary.180 and higher
(#13920)
fix(nextjs): Drop _not-found spans for all HTTP methods
(#13906)
fix(nextjs): Fix resolution of request storage shim fallback
(#13929)
fix(node): Ensure graphql options are correct when preloading
(#13769)
Relevant for users of the @sentry/nextjs package: If you have previously configured a
SENTRY_IGNORE_API_RESOLUTION_ERROR environment variable, it is now safe to unset it.
Other Changes
feat(cdn): Export getReplay in replay CDN bundles
(#13881)
feat(replay): Clear fallback buffer when switching buffers
(#13914)
feat(replay): Upgrade rrweb packages to 2.28.0 (#13732)
fix(docs): Correct supported browsers due to globalThis
(#13788)
fix(nextjs): Adjust path to requestAsyncStorageShim.js template file
(#13928)
fix(nextjs): Detect new locations for request async storage to support Next.js v15.0.0-canary.180 and higher
(#13920)
fix(nextjs): Drop _not-found spans for all HTTP methods
(#13906)
fix(nextjs): Fix resolution of request storage shim fallback
(#13929)
fix(node): Ensure graphql options are correct when preloading
(#13769)
Bumps the safe group with 34 updates in the / directory:
6.12.5
6.14.0
6.6.8
6.6.10
7.5.7
7.5.9
4.0.0
4.0.2
8.10.3
8.12.0
5.2.14
5.2.16
11.2.14
11.2.16
2.2.7
2.3.0
8.32.0
8.34.0
3.54.0
3.54.1
9.1.0
9.1.1
6.7.0
6.8.0
7.25.6
7.25.7
7.25.2
7.25.8
7.25.1
7.25.8
7.24.7
7.25.7
7.25.4
7.25.7
7.24.7
7.25.7
7.24.7
7.25.7
7.25.4
7.25.8
7.24.7
7.25.7
7.24.6
7.25.7
7.25.6
7.25.7
8.3.4
8.3.5
8.3.4
8.3.5
8.3.4
8.3.5
8.3.4
8.3.5
8.3.4
8.3.5
8.3.4
8.3.5
2.30.0
2.31.0
50.3.0
50.4.1
7.37.0
7.37.1
3.0.2
3.0.3
16.9.0
16.10.0
Updates
@formatjs/intl-datetimeformat
from 6.12.5 to 6.14.0Release notes
Sourced from
@formatjs/intl-datetimeformat
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-displaynames
from 6.6.8 to 6.6.10Release notes
Sourced from
@formatjs/intl-displaynames
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-listformat
from 7.5.7 to 7.5.9Release notes
Sourced from
@formatjs/intl-listformat
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-locale
from 4.0.0 to 4.0.2Release notes
Sourced from
@formatjs/intl-locale
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-numberformat
from 8.10.3 to 8.12.0Release notes
Sourced from
@formatjs/intl-numberformat
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-pluralrules
from 5.2.14 to 5.2.16Release notes
Sourced from
@formatjs/intl-pluralrules
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@formatjs/intl-relativetimeformat
from 11.2.14 to 11.2.16Release notes
Sourced from
@formatjs/intl-relativetimeformat
's releases.Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@reduxjs/toolkit
from 2.2.7 to 2.3.0Release notes
Sourced from
@reduxjs/toolkit
's releases.... (truncated)
Commits
77fb33d
Release 2.3.0fa0906e
Merge pull request #4291 from reduxjs/pr/fetchBaseQuery-extraOptions896e4df
Drop generic and make extraOptions unknown41487fd
Fix arguments type1918f13
fix bad inference with an overload?6ef362f
fixup test3e77381
fetchBaseQuery: expose extraOptions to prepareHeaders7b50a61
Merge pull request #4561 from reduxjs/feature/4106-rtkq-normalization3358c13
Fix Parameters headersd38ff98
Merge pull request #4638 from kyletsang/prepareheaders-argsUpdates
@sentry/react
from 8.32.0 to 8.34.0Release notes
Sourced from
@sentry/react
's releases.... (truncated)
Changelog
Sourced from
@sentry/react
's changelog.... (truncated)
Commits
d7749ae
release: 8.34.02a1dd9a
Merge pull request #13941 from getsentry/prepare-release/8.34.020914b0
meta(changelog): Update changelog for 8.34.086c626e
fix(nextjs): Fix resolution of request storage shim fallback (#13929)fcc3d2b
meta(ci): Don't fail CI run when codecov fails to upload (#13930)0b00605
ci(deps): bump peter-evans/create-pull-request from 6.1.0 to 7.0.5 (#13844)6b4401f
fix(nextjs): Detect new locations for request async storage to support Next.j...0be3137
fix(nextjs): Adjust path torequestAsynStorageShim.js
template file (#13928)d7c33a2
feat(replay): Upgrade rrweb packages to 2.28.0 (#13732)37b45c1
feat(replay): Clear fallback buffer when switching buffers (#13914)Updates
apexcharts
from 3.54.0 to 3.54.1Release notes
Sourced from apexcharts's releases.
Commits
3f73670
build - 3.54.1608954f
3.54.1fc02faa
typo fix for showDuplicatesa7ee8bf
fix #4757; allow duplicate labels in yaxis3521cbe
continue fix for #4750; tooltip missing in safaricbeb9cb
fix #4623; use x value from w.config.series instead of w.globals.labels4b82033
fix #4750; safari tooltip issuea72dc52
update samples4cd7886
Merge pull request #4753 from rosco54/Bar_Column_True_Stroke_Pathfedbcce
Restore true stroke paths on bars and columns.Updates
query-string
from 9.1.0 to 9.1.1Release notes
Sourced from query-string's releases.
Commits
9fce3f9
9.1.119c43d4
FixarrayFormat
bracket-separator
with a URL encoded value (#392)4287e77
Meta tweaksUpdates
react-intl
from 6.7.0 to 6.8.0Release notes
Sourced from react-intl's releases.
Commits
b338b97
build: publish619695b
chore: reformat96725cb
feat(react-intl): adopt React.JSX types in prep for React 1900bc9f1
fix(react-intl): rm stray package-lock.jsona43c8ab
chore: upgrade deps9dbdbf1
chore: reformat21b2e71
chore: upgrade deps3e31d11
chore(deps): update dependency@types/benchmark
to v2.1.5 (#4561)7b2b725
chore: add onlyBuiltDependencies to package.jsonc279957
build(deps): bump cookie and express (#4556)Updates
@babel/cli
from 7.25.6 to 7.25.7Release notes
Sourced from
@babel/cli
's releases.Changelog
Sourced from
@babel/cli
's changelog.Commits
2533cfb
v7.25.77722f23
Updatetypescript
&typescript-eslint
(#16826)69d65f1
[babel 8] Require Node.js^18.20.0 || ^20.17.0 || >=22.8.0
(#16800)Updates
@babel/core
from 7.25.2 to 7.25.8Release notes
Sourced from
@babel/core
's releases.