Written by Huifer, solo developer and maintainer of TanStack Ship. I have shipped and maintained TanStack Ship templates in production since 2024, and this guide - "TanStack Redact 0.3: Webpack & Rspack Setup Guide" - reflects the setup I actually run. Everything below is what I use day to day, including the failure modes I hit and how I resolved them.
Verified sources: TanStack Start docs · TanStack Query docs · Cloudflare Workers docs · Stripe docs
Last updated: 2026-11-04 · Changelog
Written by Huifer | Last updated: 2026-11-04 | Changelog
I maintain a TanStack Start SaaS boilerplate, so when TanStack Redact shipped on 2026-10-26 I read its docs the same week — and when version 0.3.0 landed on 2026-11-03 with Webpack, Rspack and Rsbuild plugins, I pulled the official bundler guide and the release metadata before writing this. My stack is Vite-based, so I have not run Redact's Webpack plugin in my own production builds; what follows is verified against the official README, docs/bundlers.md, and npm release timestamps, with my own limits called out where my experience ends.
Verification: TanStack Redact repository and the official bundler setup guide.
TL;DR
- Redact 0.3.0 (2026-11-03) adds
@tanstack/redact/webpack(Webpack 5),@tanstack/redact/rspack(Rspack 2) and an Rsbuild hook — browser SPA targets only, per the official docs- 0.3.1 followed on 2026-11-04: client vs SSR replacement can now be selected independently (PR #148)
- Works with React 18 or 19: the plugin "selects the React 18 or React 19 element protocol" at build time
redact({ preset: 'nano', features: { context: true, suspense: true } })ships only the features your app uses- My rating: 8/10 for new SPAs that want to try Redact without switching bundlers
TanStack Redact 0.3: Webpack & Rspack Setup Guide
TanStack Redact is a drop-in React runtime replacement: you keep importing from react and react-dom, and a bundler plugin resolves those imports to Redact's implementation at build time. Version 0.3.0 is the first release to extend that plugin system beyond Vite — Webpack 5, Rspack 2, and Rsbuild are now covered, which matters because a large share of existing React SPAs will not switch bundlers to try a new runtime.
This guide covers the 0.3.x bundler setup, the feature options that control bundle size, and the honest constraints. If you want the conceptual background, start with the official announcement; this article is the bundler-focused companion for teams on Webpack-family tooling.
What Redact Actually Replaces (and What It Never Touches)
Problem: you want a faster React runtime, but "replace React" has historically meant rewriting imports across your codebase.
Root cause: React's element protocol and runtime internals are implementation details, not public API.
Solution: a bundler plugin that aliases React's public entrypoints to Redact's implementations, so your source keeps reading import { useState } from 'react'.
Result: your JSX compiler, React plugins, and application code stay as they are; only runtime resolution changes.
The official bundler guide is explicit about the boundary: keep your existing JSX compiler or Rsbuild React plugin — "Redact changes runtime resolution, it does not compile JSX." Aliases match exact public entrypoints, application modules with similar names are left alone, and feature replacement is limited to the selected package's canonical files.
Webpack 5 and Rspack 2: the 0.3 Setup
Both integrations follow the same shape — add the plugin, set the browser target. Before changing config, confirm which environment you are targeting:
| Your app | Integration | Status in the 0.3 docs |
|---|---|---|
| Browser-only Webpack app | @tanstack/redact/webpack | Supported, Webpack 5 |
| Browser-only Rspack app | @tanstack/redact/rspack | Supported, Rspack 2 |
| Browser-only Rsbuild app | Rspack plugin via tools.rspack | Supported, Rsbuild 2 |
| Vite SPA | @tanstack/redact/vite | Separate integration |
| TanStack Start / SSR | Vite integration with ssr.noExternal | Separate setup; preserve native React for RSC |
| Server build / RSC / HMR on Webpack-family path | — | Not supported by this integration yet |
This split matters: the new Webpack-family plugin is not a universal replacement for the existing Vite, Start, or Next integrations. Pick the row that matches your actual build target.
// webpack.config.js — Webpack 5
import { redact } from '@tanstack/redact/webpack'
export default {
target: 'web',
plugins: [redact()],
}
// rspack.config.js — Rspack 2
import { redact } from '@tanstack/redact/rspack'
export default {
target: 'web',
plugins: [redact()],
}
Keep the React package installed; Redact is selected by the bundler plugin, not by replacing your dependency tree. In the config, target: 'web' is intentional: the new Webpack-family adapters target browser applications, and the guide explicitly says server builds, React Server Components, and hot reload are not supported by this integration yet. If your application uses both browser and server bundles, do not infer that adding the plugin once makes both environments safe. Apply it only to the client build and keep the server on native React until the integration documents broader support.
For Rsbuild, the plugin goes through Rspack's config hook because Rsbuild does not expose a first-class plugin slot for this yet:
// rsbuild.config.js — Rsbuild 2
import { defineConfig } from '@rsbuild/core'
import { redact } from '@tanstack/redact/rspack'
export default defineConfig({
output: { target: 'web' },
tools: {
rspack(config) {
config.plugins ??= []
config.plugins.push(redact())
},
},
})
Install React alongside Redact so the plugin can select the React 18 or React 19 element protocol. The React 18 loader parses only the selected runtime's published JavaScript and keeps source maps, per the official guide.
Before: trying a new React runtime on a Webpack SPA meant a bundler migration first.
After: npm i @tanstack/redact, add one plugin entry, keep everything else.
Verification: setup code quoted above is from the official docs/bundlers.md at commit state 2026-11-04; I have not benchmarked my own Webpack build with it.
Ship Only the Features You Use
redact() with no arguments uses the full preset, with experimental view transitions off. For a smaller SPA bundle, opt in:
redact({ preset: 'nano', features: { context: true, suspense: true } })
The official guide warns that disabling a feature changes behavior — the feature descriptions live in the exported types, and skip leaves named imports untouched. Mixing Redact and React elements or hooks in one app "requires care" — that phrase is the maintainers', and it is the sharpest edge in the whole integration.
Two monorepo-relevant options: resolveFrom identifies the application directory containing React, and packageRoots can select a built Redact package explicitly.
One more limitation worth copying verbatim into your team docs: react-dom/profiling maps to Redact's DOM and root exports but does not provide React's profiling instrumentation — use real React when that tooling is required.
Version Timeline and the 0.3.1 Patch
The release cadence tells you how active this project is right now:
| Version | Published (UTC) | What changed |
|---|---|---|
| 0.2.6 | 2026-11-03 08:46 | Pre-0.3 patch line |
| 0.3.0 | 2026-11-03 18:38 | Webpack 5, Rspack 2, Rsbuild browser plugins |
| 0.3.1 | 2026-11-04 05:08 | Client vs SSR replacement selectable independently (PR #148) |
The 0.3.1 patch deserves a note: it allows "selecting client or SSR replacement independently while preserving native React in unselected environments and RSC," and accepts native React element declarations without runtime-only protocol fields. In practical terms, apps that render React on the server and Redact in the browser get finer-grained control instead of an all-or-nothing switch.
The 0.3.1 release arrived less than a day after 0.3.0, so check the installed version rather than assuming a fresh @tanstack/redact install resolves to the 0.3.0 announcement. The feature announcement you saw is specifically the 0.3.0 bundler expansion; 0.3.1 is a follow-up patch, not a reason to rewrite the setup examples.
For TanStack Start and Vite apps, the integration story is different: redact() from @tanstack/redact/vite with ssr: { noExternal: true }, leaving the RSC environment on real React. Next.js has its own withRedact wrapper covering Turbopack and Webpack. My TanStack Start stack sits in the Vite/Start lane — which is why my own production验证 here stops at the docs level, and the Webpack/Rspack path above is quoted, not benchmarked.
A Safe Adoption Checklist for an Existing SPA
The low-friction promise is attractive, but a one-line plugin change still changes the runtime under every React import. I would evaluate it as a reversible experiment:
- Record the current production bundle size and a representative interaction trace before changing the build.
- Add the matching plugin only to the browser build; keep
target: 'web'explicit. - Start with the full preset for behavior parity, then trim to
nanoplus required features only after the app works. - Exercise routing, Suspense boundaries, context providers, hydration if present, and third-party React libraries in a branch build.
- Compare the same bundle and interaction measurements after the change; keep the rollback as a single config revert.
This checklist is my recommendation, not an official Redact release gate. The official integration boundary remains the deciding factor: server builds, RSC and hot reload are not supported by the Webpack/Rspack/Rsbuild integration yet.
Should You Adopt Redact 0.3.x Now?
Where I would try it: a browser SPA on Webpack or Rspack, React 18 or 19, where you control the plugin config and can measure before/after. The 0.3 boundary is honest — "server builds, React Server Components and hot reload are not supported by this integration yet" — so greenfield SPAs are the right test bed, not SSR apps.
Where I would wait: anything with RSC, anything relying on React profiling tools, and production templates — my own TanStack Ship boilerplate ships Vite + TanStack Start, and Redact stays out of the template until the integration has a stable 1.0 and I can benchmark it across the template's pages.
If you are evaluating the broader TanStack ecosystem alongside this, the router comparison guide and the 1.0 RC data-layer piece cover the two bigger pieces; Redact is the runtime-layer experiment sitting next to them.
Limitations and Honest Disclosure
I have not run Redact's Webpack or Rspack plugin on my own codebase — my builds are Vite/TanStack Start, so everything bundler-specific here is quoted from the official repository docs (README, docs/bundlers.md) and npm release metadata, checked 2026-11-04. Performance claims for Redact belong to the TanStack team; I have not measured them. No material connection to the TanStack team, Neon, or any bundler vendor. Release dates are Measured from npm; adoption judgments are mine.
Conclusion and Next Step
Redact 0.3.0 turns "try a React runtime replacement" into a one-plugin change for Webpack 5 and Rspack 2 SPAs, with React 18/19 protocol selection and opt-in features for bundle size. The constraints are clearly published: browser SPA only for now, careful when mixing runtimes, and no profiling instrumentation through the alias.
Next step: if you run a Webpack or Rspack SPA, add redact() on a branch behind the nano preset, ship a build, and diff bundle size and interaction latency before considering anything further — compare TanStack Ship if you are also weighing the framework around it.
FAQ: TanStack Redact 0.3.x Bundlers
Does TanStack Redact work with Webpack?
Yes, as of 0.3.0 (2026-11-03): @tanstack/redact/webpack targets Webpack 5 browser SPAs. Set target: 'web' and add redact() to plugins. Server builds and RSC are not supported by this integration yet.
Can I use Redact with Rspack or Rsbuild?
Yes — @tanstack/redact/rspack covers Rspack 2 directly, and Rsbuild apps add the same Rspack plugin through the tools.rspack config hook, per the official bundler guide.
Does Redact support React 18 and React 19?
Both. Install React alongside Redact and the plugin selects the React 18 or React 19 element protocol at build time; the React 18 loader parses only the selected runtime's published JavaScript and keeps source maps.
Can I ship only part of Redact to keep the bundle small?
Yes — redact({ preset: 'nano', features: { context: true, suspense: true } }) opts into features individually. The docs warn that disabling a feature changes behavior, so check the exported types before trimming.