v2.13.0 #5457
markerikson
announced in
Announcements
v2.13.0
#5457
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This feature release updates our build tooling to TSDown and PNPM, adds official TypeScript 7 support, and includes a long list of bugfixes across RTK Query,
createAsyncThunk,createEntityAdapter, andcombineSlices.Changelog
Build Tooling Updates
We've fully modernizing modernized our build tooling across all of the Redux repos. That included switching from Yarn to PNPM, ESLint to Oxlint, Prettier to Oxfmt, and TSUp to TSDown.
The part that matters for users is that we now build the package with TSDown instead of
tsup. The package layout,exportsdefinitions, and exported APIs are all unchanged from 2.12. We've checked the new build withattw, and verified that CJS and ESM entry points load in both dev and prod builds, and that thelegacy-esmartifacts still target ES2017. The contents of the bundles do look a bit different (smaller CJS artifacts, slightly different helper output in thelegacy-esmfiles). If you see any behavior differences that look build-related, please file an issue!This is also our first release published via the updated PNPM-based workflow, still using NPM Trusted Publishing. We've also added
pkg.pr.newpreviews for every commit, so you can try out a PR build before it's released.Docs Updates
We've shipped a new combined Redux libraries docs site! The core docs site at https://redux.js.org now contains the docs for all of our libraries: Redux core and usage guides, Redux Toolkit, React Redux, and Reselect. The prior standalone docs sites for RTK, R-R, and Reselect now redirect to their respective sections of the combined docs. We've also done a major cleanup pass on the docs, deduplicating pages that had similarities (like the Next.js or RTK2 migration pages that lived in both the core and RTK docs), and updating outdated content (modernizing example code snippets, deleting dead links, and making RTK and hooks the default patterns shown). The RTK content now lives at https://redux.js.org/toolkit/ .
TypeScript 7 Support
TS 7.0 (the native Go port) is now out! We fixed the remaining type errors in RTK when checked by TS 7.0 and 7.1, and TS 7.0 is now part of our CI test matrix.
Per our TS support policy of matching DefinitelyTyped's support window, we've also updated our support matrix to TS 5.6+. As always, RTK may still work with earlier versions, but we no longer test against them.
RTK Query Fixes
useQueryState(and thususeQuery) was passing a new inline selector touseSelectoron every render, and also reading the store directly during render. The selector is now memoized, and the direct store read is gone. This also fixes a bug whereisSuccesscould flip fromfalsetotrueon an unrelated re-render while a query was refetching after an error.isSuccessnow correctly staysfalsein that case.datanow reflects cache updates made viaupdateQueryDatawhile a refetch is in flight, instead of showing the previous result.Polling now reads the current cache state when each poll fires, rather than the state at the time the poll was scheduled. This means
skipPollingIfUnfocusedrespects focus loss that happens after scheduling, and polls stop if their cache entry was removed.We fixed a race where a duplicate query request rejected by the thunk condition could cause queued tag invalidations to run too early and be lost, leaving stale data in the cache.
Tags with falsy ids like
0now invalidate and clean up correctly.Lazy query hooks now re-subscribe correctly when effects restart while the hook state is preserved, such as with Fast Refresh or
<Activity>.Infinite queries no longer trigger
onQueryStartedwhen fetching past the end of the list, and the infinite query hook result type now includes the page error flags.fetchBaseQueryonly treats a URL as absolute if it starts with a scheme.We also fixed an error when rehydrating state for an endpoint name that has no definition.
Other Fixes
createAsyncThunkno longer swallows aborts that happen before thependingaction is dispatched, and now correctly setsrejectedWithValuewhenrejectWithValueis called with a falsy payload.createEntityAdapter'ssetAllnow keeps the last item when given duplicate IDs, matchingsetMany. The sorted adapter'supdateManynow merges multiple updates for the same ID before applying them.combineSlicesnow keeps its internal state proxy cache per instance, so multiple combined reducers no longer interfere with each other.The immutability check middleware now handles circular references in state.
The dynamic middleware now caches its composed middleware chains when the list of middleware hasn't changed.
What's Changed
pkg.pr.newby @aryaemami59 in ci: publish preview packages on every commit viapkg.pr.new#5256entityAdapter):setAllwith duplicate IDs keeps last occurrence (consistent withsetMany) by @JSap0914 in fix(entityAdapter):setAllwith duplicate IDs keeps last occurrence (consistent withsetMany) #5321createAsyncThunkaborts that happen before pending by @chatman-media in fix: don't swallowcreateAsyncThunkaborts that happen before pending #5314useRef<T | undefined>(undefined)usages in RTK Query hooks by @DucMinhNe in SimplifyuseRef<T | undefined>(undefined)usages in RTK Query hooks #5315onQueryStartedfrom triggering at end-of-list by @joseph0926 in fix(query): preventonQueryStartedfrom triggering at end-of-list #5182remark-typescript-toolsand update to TS7 by @markerikson in Modern Tooling, Part 7: vendorremark-typescript-toolsand update to TS7 #5390rejectedWithValuefor falsyrejectWithValuepayloads by @dfedoryshchev in fix(toolkit): flagrejectedWithValuefor falsyrejectWithValuepayloads #5395immutableStateInvariantMiddlewareby @hamed-bavar in fix(toolkit): handle circular references inimmutableStateInvariantMiddleware#5433useQueryStateandisSuccessduring refetch-after-error by @markerikson in Fix unstable selector reference inside ofuseQueryStateandisSuccessduring refetch-after-error #5456Full Changelog: v2.12.0...v2.13.0
This discussion was created from the release v2.13.0.
All reactions