# TanStack Redact: Smaller React Bundles and the Scheduling Trade-Off

[TanStack Redact](https://tanstack.com/redact) replaces the React runtime delivered to the browser while keeping the component code developers already maintain. Its most striking result is a roughly 70% reduction in JavaScript for a small Vite application. That reduction can make a first visit noticeably cheaper, particularly on a slow connection.

The more consequential finding appears after the page loads. **A smaller runtime can improve startup while making a demanding interaction slower.** Redact changes how rendering work is scheduled, so download size and input responsiveness need separate evaluation. Understanding that boundary makes its bundle savings useful without turning one starter application into a claim about every React project.

<iframe class="aspect-video h-auto" width="100%" height="315" src="https://www.youtube.com/embed/MwOYrNAX1Ig" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## What changes when React becomes Redact

A normal React application imports components and hooks from `react`, with browser rendering supplied by `react-dom`. Redact's build integration redirects those dependencies to its compatible implementation. The application can retain its JSX, component boundaries, and familiar imports. This is an implementation swap below the application rather than a rewrite into a different component language.

That distinction matters when considering migration cost. A small build configuration change can affect a large dependency graph. Your own components may use only common hooks, while a router, dialog library, or chart library relies on less visible behavior. Successful compilation establishes that exports resolve; it does not establish that every interaction behaves identically.

The server boundary also remains important. In supported React Server Component integrations, including Next.js and Vinext, React still handles the server side. Redact takes over browser hydration and client updates. Framework routing, server execution, and transport do not disappear simply because the browser runtime changes.

![React remains on the server while the browser runtime is replaced](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/2deef958-e008-4599-fdfc-b36740ee4500/md2x =1920x1080)

Hydration connects existing server-rendered markup to client behavior. An application can therefore have one implementation producing its initial HTML and another attaching event handling and maintaining the browser tree. Compatibility at that handoff deserves explicit testing, especially for streaming content and state that crosses the server/client boundary.

The [Redact repository](https://github.com/TanStack/redact) and its framework integrations are the appropriate reference for supported versions. A plugin being available for a framework does not imply compatibility with every historical or future framework release. Pinning the versions used in an evaluation makes the result reproducible and leaves a clear rollback path.

## Where the 70% bundle reduction comes from

A fresh Vite React 19 application offers a useful view of the runtime's fixed cost. In the measured starter, compressed JavaScript fell from approximately 66.8 KB with React to 20.2 KB with the default Redact configuration. A more restrictive nano preset brought that total to 12.9 KB.

![The starter bundle comparison shows the cost of the default runtime and the smaller preset](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/f6ac1dde-eac7-46b6-d60b-5356ed132200/lg2x =1920x1080)

Those figures describe emitted compressed JavaScript for that application. They should not be mixed with an isolated runtime comparison, an uncompressed development bundle, or a JavaScript-plus-CSS total. Each answers a different question. Compression also depends on what code appears together, so the size of an installed package is a poor substitute for measuring the production output.

TanStack's [launch measurements](https://tanstack.com/blog/introducing-tanstack-redact) used another boundary: all emitted client JavaScript and CSS. The reported reductions ranged from about 70.5% for Vite to 20.4% for Next.js, with TanStack Start and Vinext between those endpoints. These are framework-specific sample applications, not a percentage that can be multiplied by an arbitrary production bundle.

![Four framework examples show smaller percentage savings as the surrounding client bundle grows](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/20f9eba1-4b63-4ac3-441c-c0c9502e4200/public =1920x1080)

The absolute saving is often more informative. In the starter and a larger dashboard comparison, the gap stayed close to 46 KB of compressed JavaScript. The starter fell by roughly 70%, while the dashboard fell by roughly 17%. The runtime contribution became a smaller fraction of the larger application.

![A similar absolute runtime saving represents very different percentages in the starter and dashboard](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/93c27162-68e7-4230-31b1-16df9435cb00/public =1920x1080)

This explains why dependency analysis should precede a performance promise. If most bytes belong to charts, an editor, localization data, or application logic, replacing React affects only one part of the total. Route splitting or removing an oversized dependency might have a larger effect. Redact can still provide a worthwhile reduction, but the decision should be based on transferred bytes for the routes your users actually load.

A cached repeat visit changes the calculation again. A first-time visitor may benefit from fewer bytes and less parsing, while a frequent user with cached assets spends more time interacting with the already running application. Startup and steady-state performance deserve separate budgets.

## Why synchronous rendering changes responsiveness

React's concurrent rendering machinery allows some rendering work to yield so that more urgent updates can proceed. Redact removes that scheduling machinery and renders synchronously. Once an update begins, its rendering work runs through rather than being interrupted in the same manner.

![React can yield between rendering work while a synchronous update occupies one continuous interval](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/563c2ab4-d8df-4571-0ec7-679c86156c00/public =1920x1080)

For a light interface, that difference may barely matter. A short update finishes quickly, and a smaller implementation can reduce overhead. A long update is a different case. Filtering a large dataset, creating a complex element tree, and updating many visible components can occupy the main thread long enough to delay a keypress or click.

The key distinction is elapsed work versus perceived responsiveness. A system can complete an update efficiently yet still feel less responsive if it keeps the input waiting. Conversely, yielding may spread completion across a longer interval while keeping typing responsive. A single throughput number cannot express both experiences.

This also limits what compatibility means. An API can exist and return values without providing identical scheduling semantics. Applications that rely on transitions or deferred values need behavior-level checks, not just a list of exported hooks. A test that clicks a button and eventually sees the right text may miss a pause that users notice immediately.

Redact also exposes build flags for optional features such as context, Suspense, memoization, and hydration. Disabling unused features can reduce output further. However, a feature is unused only if the complete application and its dependencies do not need it. Removing hydration from an application that depends on server-rendered interactivity is a different change from omitting an irrelevant subsystem in a purely client-rendered page.

The nano result is therefore best read as a configuration-specific lower figure. It is not a universally interchangeable replacement for the default preset. Testing the default implementation first helps isolate runtime compatibility from more aggressive feature removal.

## Compatibility involves more than the smallest runtime

[Preact](https://preactjs.com/) offers another compact implementation and a React compatibility layer. A source comparison placed its compatible runtime at approximately 11.2 KB gzipped versus 23.3 KB for Redact. That is an isolated runtime measurement, distinct from the starter application's total compressed JavaScript.

The reason to examine Redact is its intended coverage of modern React behavior. The compatibility comparison includes APIs such as `useActionState`, `useOptimistic`, and `useFormStatus`, along with transition state, Suspense, and the React Compiler runtime. These features make a pure byte comparison incomplete.

![The compatibility table compares modern React APIs alongside compressed runtime size](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/c948764b-ec25-472a-7369-aab11090e500/orig =1920x1080)

Compatibility tables are versioned evidence. They describe the implementations available when tested and should be checked against the [current compatibility documentation](https://tanstack.com/redact/latest/docs/compatibility). A missing export can be repaired in a later release; a supported export may still have behavior that matters to a particular application.

For an application already using a different lightweight runtime successfully, another migration needs a concrete benefit. For an application dependent on newer React APIs, greater compatibility may justify additional bytes. The right comparison includes the behavior the application actually exercises rather than assuming the smallest library is automatically the best fit.

An effective regression set includes forms that submit and fail, optimistic updates that roll back, dialogs that manage focus, Suspense boundaries, and navigation during pending work. These are places where implementation differences can become visible even when a static page looks correct.

## Production measurements can move in opposite directions

Early measurements from [Tanner Linsley's production experiment](https://tannerlinsley.com/posts/projecting-react) illustrate why a runtime swap needs several metrics. His smaller blog benefited from reduced transferred JavaScript. On the much larger TanStack site, the overall client JavaScript saving was closer to 5%, while Largest Contentful Paint on Server Component-heavy pages regressed in the reported experiment.

![The production experiment records modest overall JavaScript savings alongside slower content paint on some pages](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/d84b139c-3fe7-4d9c-80cd-14b6e6699a00/md2x =1920x1080)

These are historical observations from specific applications and versions. They are useful because they challenge a simplistic assumption: fewer client bytes do not guarantee that every loading metric improves. Rendering, streaming, hydration, and application structure can influence when meaningful content becomes visible.

A larger dashboard test makes the interaction trade-off more concrete. The workload used 20,000 orders, a search input, charts, and a sortable table, with TanStack Router, Query, and Table alongside Recharts and Radix. React and Redact builds received the same clicks and typing in Chrome with fourfold CPU slowdown.

![The React and Redact dashboard builds use the same dataset and throttled-browser workload](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/2401afa8-bcbd-494d-80cc-a0e4d3bfea00/lg2x =1920x1080)

The Redact build worked in that workload, transferred about 17% less JavaScript on the first visit, and painted the dashboard about 14% faster during loading. The slowest search keystroke, however, increased from roughly 80 milliseconds with React to 200 milliseconds with Redact. Results also took longer to settle.

Removing `useDeferredValue` from the comparison did not erase the gap: the reported React keystroke was approximately 168 milliseconds versus 200 milliseconds for Redact. That makes scheduling relevant without proving that one missing mechanism explains every millisecond. Different implementations can differ in rendering overhead as well as their ability to yield.

![The follow-up keystroke comparison removes useDeferredValue to separate some of the scheduling effects](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/27b4d0b2-2643-4273-7591-283bc1879800/lg2x =1920x1080)

The benchmark is an illustrative application test, not a universal result across hardware and workloads. Its strongest lesson is methodological: record startup, worst-case interaction latency, and completion time separately. A dashboard can improve one and regress another without either measurement being wrong.

For your own application, realistic CPU throttling and representative data sizes help expose work hidden by a powerful development machine. A useful evaluation also includes cold loading, cached navigation, repeated interaction, and failure states. Average timings alone can conceal the slowest input, which is often the experience that determines whether a dense application feels usable.

## A useful migration acceptance boundary

A runtime experiment is easier to judge when the acceptance criteria are written before the swap. The baseline should name a production build, representative routes, data sizes, and device conditions. Otherwise a smaller development bundle can be mistaken for a faster production experience, or a lighter dataset can conceal an interaction regression.

The most useful criteria follow user actions. A search field needs a bound on input delay, a form needs correct pending and error behavior, and a dashboard needs to remain usable while its expensive regions update. A visual snapshot can catch broken output, but it cannot establish that typing stayed responsive during the work.

Library coverage belongs in the same boundary. Dialog focus, controlled inputs, hydration, and navigation during a pending update are observable behaviors that can be exercised without asserting that the replacement implements React internally in the same way. The point is to preserve the application's contract with its users.

A rollback should change the runtime independently of application changes. Combining a runtime swap with redesigned components, a new router version, and altered data fetching makes attribution difficult. A smaller change gives a clearer explanation when a metric moves and a more reliable way to recover if a dependency exposes an edge case.

These criteria make an evaluation useful even when the decision is to retain React. The measurements identify which costs matter, which behaviors depend on scheduling, and how much of the actual bundle is available to remove.

## Final thoughts

Redact makes a clear architectural exchange: it reduces the browser runtime while changing scheduling behavior and compatibility assumptions. Small applications can see a large percentage reduction because the runtime dominates their initial bundle. Larger applications may save a similar number of bytes but a much smaller fraction of the total.

**Treat bundle size, correctness, and responsiveness as separate acceptance criteria.** Redact is most promising where its fixed savings matter and rendering work remains short. Applications with expensive interactive updates need particular care. A measured migration with pinned versions and a straightforward rollback offers a more reliable decision than either a 70% headline or a blanket rejection of alternative runtimes.
