CodeVetter · Repo Unpack · System map
reduxjs/redux-toolkit
The main product is a set of published library entrypoints consumed by application stores. RTK Query separates framework-independent request machinery from React hook generation. Redux state and middleware-local maps have distinct ownership responsibilities. Build configuration emits several module formats, while documentation deployment incorporates this checkout into the separate Redux website.
- @reduxjs/toolkit exposes four public entrypoints: the root, /react, /query, and /query/react, with conditional module-sync, browser, React Native, import, and CommonJS resolution.
- The root entrypoint exports store, slice, thunk, entity, listener, dynamic middleware, and batching APIs; /react reexports the root and adds React-specific dynamic middleware.
- React createApi is assembled by buildCreateApi(coreModule(), reactHooksModule()); the query entrypoint exposes core createApi without requiring generated React hooks.
- coreModule initializes selectors, thunks, slices, initiation functions, and middleware, then attaches endpoint select/initiate functions and thunk matchers.
- API Redux state combines queries, mutations, provided tags, subscriptions, and config; a WeakMap keyed by dispatch separately holds subscription, polling, and running-request maps.
- The pnpm workspace includes packages, docs, infinite-query examples, and type-portability fixtures. Root build/test scripts recursively filter @reduxjs/* and @rtk-query/*; workspace dependency linking is disabled.
- tsdown builds separate nested entrypoints without shared chunks, externalizes Redux/React/Immer dependencies, and emits modern ESM, development/production CJS, browser ESM, legacy ESM, and declaration variants.
- Documentation pages live here, but the Docusaurus website lives in reduxjs/redux. Netlify previews build Toolkit and the combined site using DOCS_SOURCE_REDUX_TOOLKIT; production publishes redirects to redux.js.org/toolkit.