diff --git a/src/components/landing/RedactLanding.tsx b/src/components/landing/RedactLanding.tsx new file mode 100644 index 000000000..92c801e95 --- /dev/null +++ b/src/components/landing/RedactLanding.tsx @@ -0,0 +1,161 @@ +import { Link } from '@tanstack/react-router' +import { CodeBlock } from '~/components/markdown/CodeBlock' +import { + LandingSection, + LandingSectionIntro, + LibraryLandingShell, +} from './LibraryLanding' + +const repo = 'https://github.com/TanStack/redact' + +export default function RedactLanding() { + return ( + +
+ + React + {' '} + Redact +
+
+ + + 66.3% + + + smaller default runtime than React + + + + + 12.5 kB + + + nano DOM client, gzipped + + +
+

+ Redact 0.1.0 measurements. Savings compare all client exports with + React 19.3.0. Nano disables all optional features. App sizes vary. +

+ + {`import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { redact } from '@tanstack/redact/vite' + +export default defineConfig({ + plugins: [react(), redact()], +})`} + + + } + > + +
+ + + {`import { useState } from 'react' + +export function Counter() { + const [count, setCount] = useState(0) + return ( + + ) +}`} + +
+
+ +
+ +
+ + {`// A client-rendered app without class components +redact({ + features: { hydration: false, classComponents: false }, +}) + +// All optional features off, then context enabled +redact({ preset: 'nano', features: { context: true } })`} + +

+ Disabling features changes behavior. Nano is not a + full-compatibility preset, and feature size savings are not + additive. +

+
+
+
+ +
+ +
+

+ Streaming SSR, hydration, Suspense, and Fast Refresh are + supported. Server Components stay on upstream React in the RSC + environment. React DevTools inspection is not implemented. +

+ + Read the compatibility guide + +

+ Performance depends on the workload. Published measurements + include faster state updates and slower hydration and Suspense + retries, they do not establish whole-app speedups. +

+ + Performance measurements ↗ + +
+
+
+
+ ) +} diff --git a/src/libraries/categories.ts b/src/libraries/categories.ts index edb12c9e7..8213a9a46 100644 --- a/src/libraries/categories.ts +++ b/src/libraries/categories.ts @@ -20,6 +20,7 @@ export type LibraryCategory = export const libraryCategories: Record = { start: 'framework', router: 'framework', + redact: 'framework', query: 'data', db: 'data', store: 'data', diff --git a/src/libraries/icons.ts b/src/libraries/icons.ts index a2f7ae64c..51fabb790 100644 --- a/src/libraries/icons.ts +++ b/src/libraries/icons.ts @@ -1,3 +1,4 @@ +import { EraserIcon } from '@phosphor-icons/react/Eraser' import { BrainIcon } from '@phosphor-icons/react/Brain' import { ChartLineUpIcon } from '@phosphor-icons/react/ChartLineUp' import { ClipboardTextIcon } from '@phosphor-icons/react/ClipboardText' @@ -29,6 +30,7 @@ import type { Icon } from '@phosphor-icons/react' export const libraryIcons: Record = { start: SunHorizonIcon, router: TrafficSignIcon, + redact: EraserIcon, query: SealQuestionIcon, db: DatabaseIcon, store: DresserIcon, diff --git a/src/libraries/ids.ts b/src/libraries/ids.ts index 0006f8fb7..548a742dd 100644 --- a/src/libraries/ids.ts +++ b/src/libraries/ids.ts @@ -1,6 +1,7 @@ export const libraryIds = [ 'start', 'router', + 'redact', 'query', 'table', 'charts', @@ -29,6 +30,7 @@ export type LibraryId = (typeof libraryIds)[number] export const SIDEBAR_LIBRARY_IDS = [ 'start', 'router', + 'redact', 'query', 'table', 'db', diff --git a/src/libraries/index.tsx b/src/libraries/index.tsx index 075d7b656..cb8029cb1 100644 --- a/src/libraries/index.tsx +++ b/src/libraries/index.tsx @@ -24,6 +24,7 @@ export { hotkeys, markdown, highlight, + redact, db, ai, intent, diff --git a/src/libraries/libraries.ts b/src/libraries/libraries.ts index 20b07db3f..a3530a85a 100644 --- a/src/libraries/libraries.ts +++ b/src/libraries/libraries.ts @@ -680,6 +680,29 @@ export const highlight: LibrarySlim = { }, } +export const redact: LibrarySlim = { + id: 'redact', + scarfId: 'c8168526-db90-4e35-9eaf-bb22ac7c7d18', + ...categoryStyles.framework, + name: 'TanStack Redact', + to: '/redact/latest', + tagline: 'A smaller React-compatible runtime with synchronous rendering', + description: + 'Keep your React components, hooks, and imports, with a smaller synchronous runtime, a Vite plugin, and optional features you can leave out of your bundle.', + repo: 'tanstack/redact', + frameworks: ['react'], + frameworkPackageNames: { react: '@tanstack/redact' }, + frameworkDocs: { react: 'overview' }, + corePackageName: '@tanstack/redact', + npmPackageNames: ['@tanstack/redact'], + latestVersion: 'v0', + latestBranch: 'main', + availableVersions: ['v0'], + defaultDocs: 'overview', + installPath: 'installation', + sitemap: { includeLandingPage: true, includeDocsPages: true }, +} + export const db: LibrarySlim = { id: 'db', ...categoryStyles.data, @@ -930,6 +953,7 @@ export const libraries: LibrarySlim[] = [ hotkeys, markdown, highlight, + redact, store, ranger, config, @@ -980,7 +1004,7 @@ export function isPublicLibrary( export const publicLibraries = libraries.filter(isPublicLibrary) export const librariesByGroup = { - framework: [start, router], + framework: [start, router, redact], state: [query, db, store, ai], headlessUI: [table, charts, form, hotkeys, markdown, highlight], performance: [virtual, pacer], diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index b7342ba5e..235ecd930 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -37,7 +37,6 @@ import { Route as PaidSupportRouteImport } from './routes/paid-support' import { Route as PartnersRouteImport } from './routes/partners' import { Route as PartnersEmbedRouteImport } from './routes/partners-embed' import { Route as PrivacyRouteImport } from './routes/privacy' -import { Route as RedactRouteImport } from './routes/redact' import { Route as RobotsDottxtRouteImport } from './routes/robots[.]txt' import { Route as RssDotxmlRouteImport } from './routes/rss[.]xml' import { Route as ShopRouteImport } from './routes/shop' @@ -219,6 +218,7 @@ import { Route as LibraryMarkdownVersionIndexRouteImport } from './routes/_libra import { Route as LibraryPacerVersionIndexRouteImport } from './routes/_library/pacer.$version.index' import { Route as LibraryQueryVersionIndexRouteImport } from './routes/_library/query.$version.index' import { Route as LibraryRangerVersionIndexRouteImport } from './routes/_library/ranger.$version.index' +import { Route as LibraryRedactVersionIndexRouteImport } from './routes/_library/redact.$version.index' import { Route as LibraryRouterVersionIndexRouteImport } from './routes/_library/router.$version.index' import { Route as LibraryStartVersionIndexRouteImport } from './routes/_library/start.$version.index' import { Route as LibraryStoreVersionIndexRouteImport } from './routes/_library/store.$version.index' @@ -465,11 +465,6 @@ const PrivacyRoute = PrivacyRouteImport.update({ path: '/privacy', getParentRoute: () => rootRouteImport, } as any) -const RedactRoute = RedactRouteImport.update({ - id: '/redact', - path: '/redact', - getParentRoute: () => rootRouteImport, -} as any) const RobotsDottxtRoute = RobotsDottxtRouteImport.update({ id: '/robots.txt', path: '/robots.txt', @@ -1407,6 +1402,12 @@ const LibraryRangerVersionIndexRoute = path: '/ranger/$version/', getParentRoute: () => LibraryRoute, } as any) +const LibraryRedactVersionIndexRoute = + LibraryRedactVersionIndexRouteImport.update({ + id: '/redact/$version/', + path: '/redact/$version/', + getParentRoute: () => LibraryRoute, + } as any) const LibraryRouterVersionIndexRoute = LibraryRouterVersionIndexRouteImport.update({ id: '/router/$version/', @@ -2039,7 +2040,6 @@ export interface FileRoutesByFullPath { '/partners': typeof PartnersRouteWithChildren '/partners-embed': typeof PartnersEmbedRoute '/privacy': typeof PrivacyRoute - '/redact': typeof RedactRoute '/robots.txt': typeof RobotsDottxtRoute '/rss.xml': typeof RssDotxmlRoute '/shop': typeof ShopRouteWithChildren @@ -2257,6 +2257,7 @@ export interface FileRoutesByFullPath { '/pacer/$version/': typeof LibraryPacerVersionIndexRoute '/query/$version/': typeof LibraryQueryVersionIndexRoute '/ranger/$version/': typeof LibraryRangerVersionIndexRoute + '/redact/$version/': typeof LibraryRedactVersionIndexRoute '/router/$version/': typeof LibraryRouterVersionIndexRoute '/start/$version/': typeof LibraryStartVersionIndexRoute '/store/$version/': typeof LibraryStoreVersionIndexRoute @@ -2349,7 +2350,6 @@ export interface FileRoutesByTo { '/paid-support': typeof PaidSupportRoute '/partners-embed': typeof PartnersEmbedRoute '/privacy': typeof PrivacyRoute - '/redact': typeof RedactRoute '/robots.txt': typeof RobotsDottxtRoute '/rss.xml': typeof RssDotxmlRoute '/showcases': typeof ShowcasesRoute @@ -2561,6 +2561,7 @@ export interface FileRoutesByTo { '/pacer/$version': typeof LibraryPacerVersionIndexRoute '/query/$version': typeof LibraryQueryVersionIndexRoute '/ranger/$version': typeof LibraryRangerVersionIndexRoute + '/redact/$version': typeof LibraryRedactVersionIndexRoute '/router/$version': typeof LibraryRouterVersionIndexRoute '/start/$version': typeof LibraryStartVersionIndexRoute '/store/$version': typeof LibraryStoreVersionIndexRoute @@ -2662,7 +2663,6 @@ export interface FileRoutesById { '/partners': typeof PartnersRouteWithChildren '/partners-embed': typeof PartnersEmbedRoute '/privacy': typeof PrivacyRoute - '/redact': typeof RedactRoute '/robots.txt': typeof RobotsDottxtRoute '/rss.xml': typeof RssDotxmlRoute '/shop': typeof ShopRouteWithChildren @@ -2880,6 +2880,7 @@ export interface FileRoutesById { '/_library/pacer/$version/': typeof LibraryPacerVersionIndexRoute '/_library/query/$version/': typeof LibraryQueryVersionIndexRoute '/_library/ranger/$version/': typeof LibraryRangerVersionIndexRoute + '/_library/redact/$version/': typeof LibraryRedactVersionIndexRoute '/_library/router/$version/': typeof LibraryRouterVersionIndexRoute '/_library/start/$version/': typeof LibraryStartVersionIndexRoute '/_library/store/$version/': typeof LibraryStoreVersionIndexRoute @@ -2981,7 +2982,6 @@ export interface FileRouteTypes { | '/partners' | '/partners-embed' | '/privacy' - | '/redact' | '/robots.txt' | '/rss.xml' | '/shop' @@ -3199,6 +3199,7 @@ export interface FileRouteTypes { | '/pacer/$version/' | '/query/$version/' | '/ranger/$version/' + | '/redact/$version/' | '/router/$version/' | '/start/$version/' | '/store/$version/' @@ -3291,7 +3292,6 @@ export interface FileRouteTypes { | '/paid-support' | '/partners-embed' | '/privacy' - | '/redact' | '/robots.txt' | '/rss.xml' | '/showcases' @@ -3503,6 +3503,7 @@ export interface FileRouteTypes { | '/pacer/$version' | '/query/$version' | '/ranger/$version' + | '/redact/$version' | '/router/$version' | '/start/$version' | '/store/$version' @@ -3603,7 +3604,6 @@ export interface FileRouteTypes { | '/partners' | '/partners-embed' | '/privacy' - | '/redact' | '/robots.txt' | '/rss.xml' | '/shop' @@ -3821,6 +3821,7 @@ export interface FileRouteTypes { | '/_library/pacer/$version/' | '/_library/query/$version/' | '/_library/ranger/$version/' + | '/_library/redact/$version/' | '/_library/router/$version/' | '/_library/start/$version/' | '/_library/store/$version/' @@ -3922,7 +3923,6 @@ export interface RootRouteChildren { PartnersRoute: typeof PartnersRouteWithChildren PartnersEmbedRoute: typeof PartnersEmbedRoute PrivacyRoute: typeof PrivacyRoute - RedactRoute: typeof RedactRoute RobotsDottxtRoute: typeof RobotsDottxtRoute RssDotxmlRoute: typeof RssDotxmlRoute ShopRoute: typeof ShopRouteWithChildren @@ -4243,13 +4243,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof PrivacyRouteImport parentRoute: typeof rootRouteImport } - '/redact': { - id: '/redact' - path: '/redact' - fullPath: '/redact' - preLoaderRoute: typeof RedactRouteImport - parentRoute: typeof rootRouteImport - } '/robots.txt': { id: '/robots.txt' path: '/robots.txt' @@ -5517,6 +5510,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof LibraryRangerVersionIndexRouteImport parentRoute: typeof LibraryRoute } + '/_library/redact/$version/': { + id: '/_library/redact/$version/' + path: '/redact/$version' + fullPath: '/redact/$version/' + preLoaderRoute: typeof LibraryRedactVersionIndexRouteImport + parentRoute: typeof LibraryRoute + } '/_library/router/$version/': { id: '/_library/router/$version/' path: '/router/$version' @@ -6436,6 +6436,7 @@ interface LibraryRouteChildren { LibraryPacerVersionIndexRoute: typeof LibraryPacerVersionIndexRoute LibraryQueryVersionIndexRoute: typeof LibraryQueryVersionIndexRoute LibraryRangerVersionIndexRoute: typeof LibraryRangerVersionIndexRoute + LibraryRedactVersionIndexRoute: typeof LibraryRedactVersionIndexRoute LibraryRouterVersionIndexRoute: typeof LibraryRouterVersionIndexRoute LibraryStartVersionIndexRoute: typeof LibraryStartVersionIndexRoute LibraryStoreVersionIndexRoute: typeof LibraryStoreVersionIndexRoute @@ -6461,6 +6462,7 @@ const LibraryRouteChildren: LibraryRouteChildren = { LibraryPacerVersionIndexRoute: LibraryPacerVersionIndexRoute, LibraryQueryVersionIndexRoute: LibraryQueryVersionIndexRoute, LibraryRangerVersionIndexRoute: LibraryRangerVersionIndexRoute, + LibraryRedactVersionIndexRoute: LibraryRedactVersionIndexRoute, LibraryRouterVersionIndexRoute: LibraryRouterVersionIndexRoute, LibraryStartVersionIndexRoute: LibraryStartVersionIndexRoute, LibraryStoreVersionIndexRoute: LibraryStoreVersionIndexRoute, @@ -7124,7 +7126,6 @@ const rootRouteChildren: RootRouteChildren = { PartnersRoute: PartnersRouteWithChildren, PartnersEmbedRoute: PartnersEmbedRoute, PrivacyRoute: PrivacyRoute, - RedactRoute: RedactRoute, RobotsDottxtRoute: RobotsDottxtRoute, RssDotxmlRoute: RssDotxmlRoute, ShopRoute: ShopRouteWithChildren, diff --git a/src/routes/-library-landing.tsx b/src/routes/-library-landing.tsx index 59e84d8c6..6e4fb0ffc 100644 --- a/src/routes/-library-landing.tsx +++ b/src/routes/-library-landing.tsx @@ -14,6 +14,7 @@ export type LandingLibraryId = | 'intent' | 'markdown' | 'pacer' + | 'redact' | 'query' | 'ranger' | 'router' diff --git a/src/routes/_library/$libraryId/$version.index.tsx b/src/routes/_library/$libraryId/$version.index.tsx index 662f715b5..4e109f9d9 100644 --- a/src/routes/_library/$libraryId/$version.index.tsx +++ b/src/routes/_library/$libraryId/$version.index.tsx @@ -46,6 +46,8 @@ function redirectToStaticLanding(libraryId: string, version: string) { throw redirect({ to: '/markdown/$version', params: { version } }) case 'pacer': throw redirect({ to: '/pacer/$version', params: { version } }) + case 'redact': + throw redirect({ to: '/redact/$version', params: { version } }) case 'query': throw redirect({ to: '/query/$version', params: { version } }) case 'ranger': diff --git a/src/routes/_library/redact.$version.index.tsx b/src/routes/_library/redact.$version.index.tsx new file mode 100644 index 000000000..ce5b9acf3 --- /dev/null +++ b/src/routes/_library/redact.$version.index.tsx @@ -0,0 +1,25 @@ +import { createFileRoute } from '@tanstack/react-router' +import RedactLanding from '~/components/landing/RedactLanding' +import { + beforeLoadLibraryLanding, + getLibraryLandingHead, + getLibraryLandingHeaders, + libraryLandingStaleTime, + loadLibraryLandingRouteData, +} from '../-library-landing-route' + +export const Route = createFileRoute('/_library/redact/$version/')({ + staleTime: libraryLandingStaleTime, + beforeLoad: ({ params, location }) => { + beforeLoadLibraryLanding('redact', params.version, location.href) + }, + loader: ({ params, context: { queryClient } }) => + loadLibraryLandingRouteData('redact', params.version, queryClient), + head: () => getLibraryLandingHead('redact'), + headers: () => getLibraryLandingHeaders('redact'), + component: RedactLandingRoute, +}) + +function RedactLandingRoute() { + return +} diff --git a/src/routes/redact.tsx b/src/routes/redact.tsx deleted file mode 100644 index 9f4330702..000000000 --- a/src/routes/redact.tsx +++ /dev/null @@ -1,470 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' -import { CodeBlock } from '~/components/markdown/CodeBlock' -import { seo } from '~/utils/seo' - -const repo = 'https://github.com/TanStack/redact' -const description = - 'A smaller React-compatible runtime with synchronous rendering. Install TanStack Redact, keep your React imports, and choose the features your app needs.' - -export const Route = createFileRoute('/redact')({ - head: () => ({ - meta: seo({ title: 'TanStack Redact | React, redacted.', description }), - scripts: [ - { - type: 'application/ld+json', - children: JSON.stringify({ - '@context': 'https://schema.org', - '@type': 'SoftwareSourceCode', - name: 'TanStack Redact', - description, - url: 'https://tanstack.com/redact', - codeRepository: repo, - programmingLanguage: 'TypeScript', - runtimePlatform: 'JavaScript', - }), - }, - ], - }), - component: RedactPage, -}) - -const sections = [ - ['install', 'Install'], - ['size', 'Bundle size'], - ['compatibility', 'Compatibility'], - ['features', 'Feature flags'], - ['reference', 'Plugin reference'], - ['verification', 'Before you ship'], -] - -const compatibility = [ - [ - 'Components and hooks', - 'JSX, state, effects, context, refs, memo, lazy, portals, error boundaries, and modern class lifecycles are supported. Legacy class lifecycles are no-ops.', - ], - [ - 'Suspense and hydration', - 'Fallbacks, retries, retained primary DOM, streaming boundaries, and event replay are supported. Work runs without priority scheduling.', - ], - [ - 'Transitions', - 'startTransition and useTransition run synchronously. Pending stays false. useDeferredValue returns its input. There is no time slicing or interruptible rendering.', - ], - [ - 'Actions and optimistic state', - 'useActionState returns the initial state, a no-op dispatch, and false. useOptimistic has no optimistic overlay and its setter is a no-op. useFormStatus stays idle.', - ], - [ - 'Activity', - 'Hidden DOM and state are retained. Effects, refs, and subscriptions disconnect, insertion effects stay connected. Hidden work runs synchronously.', - ], - [ - 'Server rendering', - 'String, static markup, readable stream, and pipeable stream rendering are supported. Full Fizz prerender and resume APIs are not implemented.', - ], - [ - 'Server Components', - 'The Vite RSC environment stays on upstream React. Redact does not reimplement Flight serialization.', - ], - [ - 'Caching', - 'cache returns its function and cacheSignal returns null. Client and DOM-server rendering are uncached.', - ], - [ - 'Development tools', - 'Fast Refresh works with @vitejs/plugin-react. StrictMode and Profiler render children without double invocation or profiling. React DevTools inspection is not implemented.', - ], - [ - 'React Compiler', - 'The react/compiler-runtime memo-cache entrypoint is implemented and aliased. Every compiler output pattern has not been validated.', - ], -] - -const flags = [ - ['activity', 'Hidden children unmount and lose state.'], - ['fragmentRefs', 'No Fragment DOM instance.'], - [ - 'viewTransitions', - 'No native snapshots or animation callbacks, the boundary retains state.', - ], - ['portal', 'Children render in place instead of into the target container.'], - ['context', 'Providers do not propagate values, reads return the default.'], - [ - 'suspense', - 'No fallback UI, thrown thenables still retry when they settle.', - ], - ['memo', 'No prop-equality bailout.'], - ['forwardRef', 'No wrapper forwarding, ordinary ref props still work.'], - ['lazy', 'Only already-synchronous payloads resolve.'], - [ - 'classComponents', - 'Constructor, render, and setState only, no lifecycles or error boundaries.', - ], - ['hydration', 'hydrateRoot throws, use createRoot.'], -] - -function RedactPage() { - return ( -
-
-
-
-

- TanStack{' '} - React{' '} - Redact -

-

- React, redacted. -

-

- Keep your components, hooks, and React imports. Swap in a smaller - runtime that renders synchronously, with one Vite plugin. -

- -
-
- -

- Redact 0.1.0 measurements. Savings compare all client exports with - React 19.3.0. Nano disables all optional features. App sizes vary.{' '} - - Measurement details - -

-
- - {`import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' -import { redact } from '@tanstack/redact/vite' - -export default defineConfig({ - plugins: [react(), redact()], -})`} - -
-
-
-
- -
-
-

One plugin. Same imports.

- - pnpm add @tanstack/redact - -

- Add redact() to your existing Vite plugins, keep - your framework and React plugins in place. The plugin aliases - React, React DOM, server rendering, scheduler, and JSX - entrypoints for client and SSR builds. -

- - {`// Your application code stays familiar. -import { useState } from 'react' -import { createRoot } from 'react-dom/client' - -function Counter() { - const [count, setCount] = useState(0) - return ( - - ) -} - -createRoot(document.getElementById('root')!).render()`} - -

- Redact is a React-compatible runtime, not a complete - implementation of every React behavior. Check the compatibility - differences below before switching an existing app. -

-
-
-

Less runtime to download.

-
- - - - - - - - - - - - - - - - - - - - - - -
- Production ESM runtime bundles, all React, JSX, DOM, and - DOM-client exports retained. -
RuntimeGzip size
React 19.3.069,162 bytes
Redact, default Vite configuration23,311 bytes
Redact, native animation enabled28,159 bytes
-
-

- The default bundle was 66.3% smaller in the Redact 0.1.0 release - measurement from September 11, 2026. These are runtime sizes, - your app will tree-shake differently, and the runtimes have - different scheduling capabilities.{' '} - - Measurement inputs and configurations ↗ - -

-

- Measured separately in the same release, the default DOM-client - entry is 20,139 bytes gzipped and the nano DOM-client entry is - 12,466 bytes. The React API entry is 2,764 bytes. These entries - overlap, their sizes are not additive. Nano disables all - optional features and is not a full-compatibility preset.{' '} - Choose your feature flags. -

-

- Performance depends on the workload. Published microbenchmarks - include faster state updates and slower hydration and Suspense - retries. They do not establish whole-app speedups.{' '} - - Read the performance measurements ↗ - -

-
-
-

Know what changes.

-

- Redact keeps the React component model and everyday APIs, while - leaving out concurrent scheduling. These behaviors describe the - default Vite configuration. -

- - - - - - - - - {compatibility.map(([area, behavior]) => ( - - - - - ))} - -
AreaRedact behavior
{area}{behavior}
-

- Native view transition animation is experimental and opt-in. - Production animation, hidden-tab behavior, broader resource and - navigation races, and Safari and Firefox remain unverified.{' '} - - Full API support reference ↗ - -

-
-
-

Only ship the parts you use.

-

- The default full preset enables every optional - feature except native animation. Disable behavior your app does - not use, or start with nano and turn features on - individually. Overrides merge with the preset. -

- - {`// A client-rendered app without class components -redact({ - features: { hydration: false, classComponents: false }, -}) - -// Every optional feature off, then context enabled -redact({ preset: 'nano', features: { context: true } }) - -// Experimental native view transition animation -redact({ features: { viewTransitions: true } })`} - -

- Disabling a feature changes behavior, it does not just remove an - unused export. The nano preset is not a - full-compatibility preset. Feature size savings overlap and are - not additive. -

- - - - - - - - - {flags.map(([flag, behavior]) => ( - - - - - ))} - -
Feature flagWhen disabled
- {flag} - {behavior}
-
-
-

Vite plugin reference

- - {`import { redact } from '@tanstack/redact/vite' - -redact({ - preset: 'full', - features: { viewTransitions: false }, -})`} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionPurpose
- preset - - 'full' | 'nano', defaults to{' '} - 'full'. -
- features - - Boolean overrides for the feature flags above. -
- skip - - An array of import specifiers to leave out of aliasing. -
- resolveFrom - - Package resolution root, defaults to the Vite config root. - Useful in monorepos. -
- packageRoots - - A map of package names to absolute package directories, - bypassing node_modules lookup for local builds. -
-

- For runtime internals and manual configuration, see the{' '} - - development guide ↗ - - . -

-
-
-

Try it with your app.

-

- Run your tests and production build, then check hydration, - forms, portals, navigation, and any third-party components your - app uses. Pay particular attention to code that depends on - pending transitions, actions, optimistic state, or React - DevTools. -

-

- The repository publishes{' '} - - browser test results - - ,{' '} - - real-app integration checks - - , and{' '} - - benchmark reproduction instructions - - . Use those alongside your own app's checks when deciding - whether to switch. -

-
-
-
-
-
- ) -} diff --git a/src/utils/sitemap.ts b/src/utils/sitemap.ts index 94679295f..f818b1740 100644 --- a/src/utils/sitemap.ts +++ b/src/utils/sitemap.ts @@ -16,7 +16,6 @@ const HIGH_VALUE_NON_DOC_PAGES = [ '/', '/blog', '/libraries', - '/redact', '/learn', '/showcase', '/support', diff --git a/tests/docs-redirects.test.ts b/tests/docs-redirects.test.ts index 305687799..823567d95 100644 --- a/tests/docs-redirects.test.ts +++ b/tests/docs-redirects.test.ts @@ -22,6 +22,7 @@ const expectedLegacyOverviewTargets: Record = { markdown: 'overview', pacer: 'overview', query: 'framework/react/overview', + redact: 'overview', ranger: 'overview', router: 'overview', start: 'framework/react/overview',