From fe30d8ba6ba71e106c8482fbcd1b2162201b473a Mon Sep 17 00:00:00 2001 From: Sheraff Date: Sat, 26 Sep 2026 16:29:24 +0200 Subject: [PATCH 001/152] test: add native compiler migration evaluation harness --- benchmarks/compiler/README.md | 276 +++++++ benchmarks/compiler/build.mjs | 212 +++++ benchmarks/compiler/hydrate-scaling.mjs | 151 ++++ benchmarks/compiler/measure.mjs | 446 ++++++++++ benchmarks/compiler/process-tree.mjs | 116 +++ benchmarks/compiler/provenance.mjs | 98 +++ .../compiler/results/app-babel-baseline.json | 174 ++++ .../compiler/results/app-babel-profile.json | 83 ++ .../compiler/results/babel-yuku-0.11.0.json | 769 ++++++++++++++++++ .../compiler/results/quiet-initial-babel.json | 341 ++++++++ .../compiler/results/quiet-initial-reuse.json | 361 ++++++++ .../results/quiet-initial-route-analysis.json | 277 +++++++ .../results/quiet-initial-routes-babel.json | 39 + .../results/quiet-initial-routes-yuku.json | 39 + .../compiler/results/quiet-initial-yuku.json | 345 ++++++++ .../scaling-bindings-1000-yuku-after.json | 202 +++++ .../scaling-bindings-1000-yuku-before.json | 193 +++++ .../results/scaling-hydrate-client-babel.json | 164 ++++ .../scaling-hydrate-client-yuku-after.json | 173 ++++ .../scaling-hydrate-client-yuku-before.json | 164 ++++ .../results/scaling-hydrate-server-babel.json | 164 ++++ .../scaling-hydrate-server-yuku-after.json | 173 ++++ .../scaling-hydrate-server-yuku-before.json | 164 ++++ .../scaling-initial-bindings-10-babel.json | 93 +++ .../scaling-initial-bindings-10-yuku.json | 95 +++ .../scaling-initial-bindings-100-babel.json | 93 +++ .../scaling-initial-bindings-100-yuku.json | 95 +++ .../scaling-initial-bindings-1000-babel.json | 93 +++ .../scaling-initial-bindings-1000-yuku.json | 95 +++ .../scaling-initial-hydrate-client-babel.json | 100 +++ .../scaling-initial-hydrate-client-yuku.json | 100 +++ .../scaling-initial-hydrate-server-babel.json | 100 +++ .../scaling-initial-hydrate-server-yuku.json | 100 +++ benchmarks/compiler/route-heavy.mjs | 292 +++++++ .../compiler/yuku-feasibility/README.md | 95 +++ .../yuku-feasibility/invalid-method-repro.mjs | 52 ++ .../yuku-feasibility/pure-comment-repro.mjs | 27 + .../tests/code-splitter-runtime.test.ts | 179 ++-- .../test-files/react/shared-runtime.tsx | 12 +- .../router-plugin/tests/hmr-exports.test.ts | 121 +++ 40 files changed, 6755 insertions(+), 111 deletions(-) create mode 100644 benchmarks/compiler/README.md create mode 100644 benchmarks/compiler/build.mjs create mode 100644 benchmarks/compiler/hydrate-scaling.mjs create mode 100644 benchmarks/compiler/measure.mjs create mode 100644 benchmarks/compiler/process-tree.mjs create mode 100644 benchmarks/compiler/provenance.mjs create mode 100644 benchmarks/compiler/results/app-babel-baseline.json create mode 100644 benchmarks/compiler/results/app-babel-profile.json create mode 100644 benchmarks/compiler/results/babel-yuku-0.11.0.json create mode 100644 benchmarks/compiler/results/quiet-initial-babel.json create mode 100644 benchmarks/compiler/results/quiet-initial-reuse.json create mode 100644 benchmarks/compiler/results/quiet-initial-route-analysis.json create mode 100644 benchmarks/compiler/results/quiet-initial-routes-babel.json create mode 100644 benchmarks/compiler/results/quiet-initial-routes-yuku.json create mode 100644 benchmarks/compiler/results/quiet-initial-yuku.json create mode 100644 benchmarks/compiler/results/scaling-bindings-1000-yuku-after.json create mode 100644 benchmarks/compiler/results/scaling-bindings-1000-yuku-before.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-client-babel.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-client-yuku-after.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-client-yuku-before.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-server-babel.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-server-yuku-after.json create mode 100644 benchmarks/compiler/results/scaling-hydrate-server-yuku-before.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-10-babel.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-10-yuku.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-100-babel.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-100-yuku.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-1000-babel.json create mode 100644 benchmarks/compiler/results/scaling-initial-bindings-1000-yuku.json create mode 100644 benchmarks/compiler/results/scaling-initial-hydrate-client-babel.json create mode 100644 benchmarks/compiler/results/scaling-initial-hydrate-client-yuku.json create mode 100644 benchmarks/compiler/results/scaling-initial-hydrate-server-babel.json create mode 100644 benchmarks/compiler/results/scaling-initial-hydrate-server-yuku.json create mode 100644 benchmarks/compiler/route-heavy.mjs create mode 100644 benchmarks/compiler/yuku-feasibility/README.md create mode 100644 benchmarks/compiler/yuku-feasibility/invalid-method-repro.mjs create mode 100644 benchmarks/compiler/yuku-feasibility/pure-comment-repro.mjs create mode 100644 packages/router-plugin/tests/hmr-exports.test.ts diff --git a/benchmarks/compiler/README.md b/benchmarks/compiler/README.md new file mode 100644 index 00000000000..752c2ade4d1 --- /dev/null +++ b/benchmarks/compiler/README.md @@ -0,0 +1,276 @@ +# Compiler migration benchmarks + +These local wall-clock measurements separate a Babel/Yuku toolkit feasibility +comparison from the complete existing route splitter and actual Vite builds. +They are not CodSpeed runtime benchmarks. A faster toolkit roundtrip does not +establish an equivalent speedup in a migrated compiler or application build. + +Use the Node version in `.nvmrc` and the root pnpm version. Build both workspaces +through Nx before timing: workspace package imports consume `dist`. The default +modes benchmark the native compiler; select Babel modes against a baseline checkout. +Do not run builds, tests, installation, or other CPU-heavy work concurrently. + +```sh +CI=1 NX_DAEMON=false pnpm nx run @tanstack/router-plugin:build --outputStyle=stream --skipRemoteCache +node benchmarks/compiler/measure.mjs > candidate.json +``` + +`--yuku-root` optionally selects a directory containing `node_modules/yuku-analyzer` +and `node_modules/yuku-codegen`; by default these resolve from the workspace's +router-utils package. The recorded evaluation uses version 0.11.0 of both. +The override was used for the initial isolated toolkit evaluation. Resolve Babel +from the baseline workspace dependencies. Preserve baseline build outputs/results +before rebuilding migrated packages. + +The default is five fresh Node processes for each mode, two untimed warmup +passes, and twenty measured passes per process. Modes rotate order between +repetitions. `--repetitions`, `--iterations`, `--warmups`, and `--modes` override +these settings. A corpus hash protects against fixture edits during a run. + +- `babel-roundtrip`: parse each React/Solid code-splitter fixture, traverse and + resolve referenced identifiers through Babel scopes, and print the full AST + with comments and source maps containing the original source. +- `yuku-roundtrip`: analyze the identical fixture source, materialize and query + the resolved-reference records, and print the full AST with all comments and + source maps containing the original source. Printing forces access to the + complete lazily decoded AST. This performs no route transformation. +- `babel-splitter`: run grouping detection, shared-binding analysis, reference + compilation, every configured virtual group, and an optional shared module for + each fixture and all three existing snapshot grouping configurations. This is + a deliberate complete-output workload; a real bundler may request fewer + virtual groups. Parse counts are accounted from one full-source parse in each + current compiler entry point, not a parser instrument or template parse count. +- `yuku-splitter`: run the same full-output workload with the native compiler, + reusing one immutable analysis for all outputs of each grouping scenario. +- `yuku-splitter-no-reuse`: omit the optional analysis from each native compiler + entry point to attribute the separate effect of analysis reuse. + +Phase times include normal allocations and GC. Process wall time additionally +includes module loading, fixture loading, warmups, explicit GC, and process +startup/exit. `process.resourceUsage().maxRSS` is the peak process resident size, +including native allocations. Heap/RSS samples before, after, and following an +explicit final GC are also recorded. Peak RSS covers warmups and all measured +passes, so compare identical iteration counts. No AST cache is kept by this +harness; the memory numbers do not predict a future compiler cache's retention. + +## Application builds + +First inspect the app's Nx build target and build it through Nx with all required +package outputs current. Then run repeated fresh-process Vite production builds: + +```sh +node benchmarks/compiler/build.mjs > app-baseline.json +node benchmarks/compiler/build.mjs --profile --repetitions 1 > app-profile.json +``` + +The default app is `e2e/react-router/basic-file-based-code-splitting`; `--app` +accepts another repository-relative Vite app. These timings include config +loading, route generation, transforms, bundling, minification, and disk writes. +They exclude TypeScript's separate `tsc --noEmit` phase and Nx/package-build +orchestration. Each run starts a fresh Node process, but OS filesystem caches +are warm and existing generated routes remain present. The harness checks that +app source content is stable between runs. It preserves the app's Vite config. + +The optional profiler wraps TanStack/router Vite hooks for attribution. Run it +separately from reported uninstrumented timings; overlapping asynchronous hook +durations must not be summed as a fraction of wall time. Peak RSS describes the +Vite Node process, including in-process native threads, not the simultaneous sum +of every possible bundler subprocess. Full process-tree memory requires a +separate system-level measurement before an adoption decision. + +## Recorded baseline + +`results/babel-yuku-0.11.0.json` records the first longer comparison on Apple M3 +Max, Node 24.8.0, with 53 fixtures (including `shared-runtime.tsx`). Five fresh +processes per mode, two warmups, twenty measured passes: + +| Workload | Median ms per corpus | Min–max ms | Median peak RSS | +| ------------------------------------ | -------------------: | ------------: | --------------: | +| Babel parse, references, print | 13.48 | 13.25–13.80 | 302.6 MiB | +| Yuku analyze, references, print | 4.94 | 4.74–5.22 | 146.6 MiB | +| Full Babel splitter, three groupings | 302.43 | 299.19–313.72 | 404.5 MiB | + +The toolkit roundtrip was about 2.73 times faster and used less peak process +memory in this workload. Full splitter phases were grouping detection 25.89 ms, +shared analysis 21.43 ms, reference compilation 112.03 ms, virtual compilation +134.73 ms, and shared compilation 8.20 ms. Each complete corpus pass accounts +for 877 full-source parses and produces 530 generated modules; 29 reference +requests pass through unchanged and 29 shared modules are generated. + +No migrated compiler or whole-build speedup is demonstrated by these numbers. + +The existing React code-splitting e2e app also completed five fresh-process Vite +builds with the baseline compiler: median 394.35 ms (391.89–409.58 ms), median +peak Vite process RSS 290.3 MiB, median total worker wall time 514.3 ms. A separate +profile found 14 reference transforms (32.28 ms), 13 virtual transforms +(13.80 ms), and one shared transform (2.10 ms). This small app spends much of its +build outside the router compiler, so it cannot demonstrate a dramatic overall +build reduction from parsing alone. Raw samples are in `app-babel-baseline.json` +and the separately instrumented `app-babel-profile.json`. + +## Start output audit + +The initial native Start compiler passed 123 existing tests across compiler +resolution, server functions (client, SSR caller, and provider), middleware, +isomorphic functions, environment-only functions, and server-side ClientOnly +JSX. All 36 updated snapshot files were independently parsed and compared with +their baseline versions. After ignoring locations, comments, formatting metadata, +and equivalent quoted object-property keys, their ASTs were identical. This is +an additional migration audit, not a requirement that future compiler output +remain textually or structurally identical. Runtime tests and source-map tests +remain the correctness authority. + +These early measurements are exploratory: final adoption measurements must run +in a coordinated quiet window with no builds, tests, or dependency installation +running in parallel. Final comparisons use the same fixture corpus for both +workspaces via `--fixtures-root` and a separately built baseline checkout: + +```sh +node benchmarks/compiler/measure.mjs --workspace /path/to/baseline --fixtures-root /path/to/candidate --modes babel-roundtrip,babel-splitter > baseline.json +node benchmarks/compiler/measure.mjs --workspace /path/to/candidate --fixtures-root /path/to/candidate --modes yuku-roundtrip,yuku-splitter > candidate.json +``` + +The native splitter mode shares one immutable route analysis across every output +within each grouping scenario. The three scenarios represent separate build +configurations, so each route is analyzed once per scenario (three source parses +per route across the complete corpus workload). +Its phase timings include this initial analysis. The production plugin's bounded +cache may have different reuse rates depending on bundler request order, so +application measurements remain necessary. + +`build.mjs --workspace /path/to/workspace --app e2e/react-start/basic` uses Vite's +application builder (`createBuilder().buildApp()`), matching the CLI across all +configured Start environments. Earlier exploratory app samples predate that +harness change and used the single-environment `build()` API on a Router-only +app. Rerun both workspaces with the current harness for final comparisons. + +The independent import-protection review added six failing parenthesis cases +before the fix: wrapped client/server safe-boundary functions and callees, +parenthesized namespace-member mock export discovery, and source-location +preference for a parenthesized call. The native implementation now unwraps +transparent expressions while retaining the direct-function-argument boundary +rule. An immediately invoked function remains an unsafe argument. All 109 tests +in the focused compiler/import-analysis run pass, including a public executable +regression that distinguishes same-name re-exports from different modules. + +## Initial native compiler comparison + +The first coordinated quiet window used the baseline checkout at `bb4423e` +and the native Yuku 0.11.0 implementation, Node 24.8.0 on Apple M3 Max. +No installation, builds, or tests ran concurrently. Both engines read the +same original 52 fixtures (43,238 bytes, corpus hash recorded in each JSON). +Three fresh processes per mode performed two warmups and five measured passes. + +| Workload | Babel | Native Yuku | Time reduction | Peak process RSS, Babel → Yuku | +| ----------------------------------------- | ---------: | ----------: | -------------: | -----------------------------: | +| Complete splitter, three configurations | 313.16 ms | 92.05 ms | 70.6% | 385.7 → 183.3 MiB | +| Synthetic 250-route production Vite build | 1800.76 ms | 1048.70 ms | 41.8% | 729.3 → 631.7 MiB | + +The splitter produces the same 517 outputs and 26 shared modules, accounting +for 858 versus 156 full-source analyses. The synthetic production workload +uses shared route state, loader/component/pending/error split groups, +minification and source maps. Both builds emitted 751 chunks and 722,613 +JavaScript bytes from identical input hashes. These are measured workloads, +not predictions for all applications. Results: `quiet-initial-babel.json`, +`quiet-initial-yuku.json`, and `quiet-initial-routes-{babel,yuku}.json`. + +A separate native-only attribution comparison disables analysis reuse only +inside the benchmark harness: 100.47 ms with reuse versus 140.69 ms without +(28.6% reduction), with peak process RSS 186.5 versus 294.5 MiB. Outputs remain +517 in both modes. This comparison separates reuse from the native compiler +rewrite; it does not add a production compatibility mode. + +Separate loader instrumentation of the actual 250-route Vite build counted +751 `analyzeRouteModule` calls: each route three times and the entry once. +The bounded 128-entry cache does not guarantee one analysis per route under +this bundler request order. This counts full route analyses, not parsing of +generated snippets. Instrumented timings are excluded from speed comparisons. +Raw results are `quiet-initial-reuse.json` and +`quiet-initial-route-analysis.json`. + +For a separate process-tree memory diagnostic (including bundler subprocesses), +run `node benchmarks/compiler/process-tree.mjs route-heavy.mjs --workspace /path/to/workspace`. +It samples simultaneous process-tree RSS every 50 ms; short-lived peaks may fall +between samples. Its timings must not be used as uninstrumented speed results. +The worker's own kernel-reported peak RSS is also retained. + +The optional `route-heavy.mjs --analysis-cache-limit 256` experiment substitutes +only the compiled cache-size constant with a benchmark-local module loader hook. +It asserts that the expected constant was found, does not modify package files, +and adds no production option. Compare limits against the default on both a +working set that fits and one that exceeds the larger bound. Analyze retained +memory before treating improved cache hit rates as an adoption reason. + +`hydrate-scaling.mjs --workspace /path/to/workspace --env client` exercises the +same Start compiler host and Hydrate plugin APIs in either checkout. Repeat with +`--env server`. The default route contains 10, 100, or 500 boundaries, each +using its own single-use constant props object with a hydration condition and +fallback. This measures scaling inside one growing module, including native +binding lookup, fallback removal, analysis, code generation and source maps. +Each measured pass creates a fresh compiler and plugin; it does not time a warm +output-cache hit. Client boundary counts and server fallback removal are checked. +Virtual child-module generation is excluded so the per-spread lookup mechanism +can be assessed separately from repeatedly generating a growing source module. + +`measure.mjs --bindings 100 --modes yuku-splitter` replaces the fixture corpus +with one synthetic route whose single object-destructuring declaration has that +many bindings, all consumed by both its loader and component. Compare 10, 100, +and 1,000 using `babel-splitter` in the baseline workspace and `yuku-splitter` in +the candidate. The same three grouping scenarios run in both engines. This +isolates scaling of declaration dependency expansion without leaving unused +bindings that could change the amount of generated work between engines. + +Final JSON includes a hash of the built compiler JavaScript files consumed by +workspace imports. App input hashes exclude generated route trees and build/test +output directories. Ensure all affected packages are rebuilt before comparing. +Route-heavy runs additionally record memory before/after the build and after +final GC. The diagnostic `--profile-analysis` run samples memory with GC before +and after the plugin's build-end cache clear, alongside its live entry count. +Post-build retention therefore measures cleanup; it is not the live-cache size. +RSS differences around clearing are allocator observations, not exact attribution +of all native allocations to cache entries. + +## Dense module scaling before optimization + +Quiet scaling checks exposed a native Hydrate regression that the many-small-route +workload misses. Three fresh processes, one warmup and three measured compiles +per process, all using the same input source: + +| Boundaries | Environment | Babel ms | Native before optimization ms | Peak RSS Babel → native | +| ---------: | ----------- | -------: | ----------------------------: | ----------------------: | +| 100 | client | 22.07 | 21.80 | 130.2 → 92.6 MiB | +| 500 | client | 78.27 | 176.65 | 277.9 → 198.5 MiB | +| 100 | server | 20.31 | 15.01 | 125.2 → 83.6 MiB | +| 500 | server | 56.08 | 103.62 | 204.9 → 160.3 MiB | + +The native implementation repeatedly walks the cloned module to locate a bound +spread's object initializer. The 500-boundary result motivates a single native +provenance index per transformation. Raw files are +`scaling-hydrate-{client,server}-{babel,yuku-before}.json`. + +The 1,000-binding destructuring fixture was already faster than Babel in an +initial cold single pass (4,302.65 → 466.72 ms; 308.1 → 269.7 MiB). A repeated +native preoptimization run (three fresh processes, one warmup, three passes) +measured 410.23 ms and 284.8 MiB. Its sibling dependency graph still creates a +quadratic clique; a structurally equivalent sparse representation can be tested +against these preserved measurements. Raw files are `scaling-initial-bindings-*` +and `scaling-bindings-1000-yuku-before.json`. Do not compare the cold exploratory +numbers directly with the warmed repeated measurements. + +The native fixes preserve emitted code/map byte totals in every repeated sample: + +| Workload | Native before ms | Native after ms | Babel ms | Native peak RSS before → after | +| ------------------------------------ | ---------------: | --------------: | -------: | -----------------------------: | +| Hydrate client, 100 boundaries | 21.80 | 12.78 | 22.07 | 92.6 → 89.3 MiB | +| Hydrate client, 500 boundaries | 176.65 | 52.55 | 78.27 | 198.5 → 153.8 MiB | +| Hydrate server, 100 boundaries | 15.01 | 8.44 | 20.31 | 83.6 → 79.0 MiB | +| Hydrate server, 500 boundaries | 103.62 | 36.80 | 56.08 | 160.3 → 123.8 MiB | +| Shared destructuring, 1,000 bindings | 410.23 | 184.56 | — | 284.8 → 202.8 MiB | + +Hydrate now builds one provenance lookup for object-expression clones per +transform. Destructuring siblings now connect through a representative instead +of a complete clique, preserving the same transitive liveness. The measured +wins justify both changes. Results retain the same source hashes, iteration +counts, output counts and generated-byte totals; see `*-yuku-after.json`. +The destructuring table deliberately omits the earlier cold Babel number to +avoid comparing different warmup/iteration configurations. diff --git a/benchmarks/compiler/build.mjs b/benchmarks/compiler/build.mjs new file mode 100644 index 00000000000..1c4dea384a4 --- /dev/null +++ b/benchmarks/compiler/build.mjs @@ -0,0 +1,212 @@ +import { compilerFingerprint } from './provenance.mjs' +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { createHash } from 'node:crypto' +import { readFileSync, readdirSync, statSync } from 'node:fs' +import { cpus } from 'node:os' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const defaultWorkspace = fileURLToPath(new URL('../../', import.meta.url)) +const args = process.argv.slice(2) +const value = (name, fallback) => { + const index = args.indexOf(name) + return index < 0 ? fallback : args[index + 1] +} +const root = path.resolve(value('--workspace', defaultWorkspace)) +const app = value('--app', 'e2e/react-router/basic-file-based-code-splitting') +const repetitions = Number(value('--repetitions', '5')) +assert.ok(Number.isSafeInteger(repetitions) && repetitions > 0) +const worker = args.includes('--worker') +const profile = args.includes('--profile') +const appRoot = path.resolve(root, app) +function sourceHash(directory) { + const hash = createHash('sha256') + function visit(dir) { + for (const name of readdirSync(dir).sort()) { + if ( + [ + 'node_modules', + 'dist', + 'test-results', + '.tanstack', + '.output', + '.vinxi', + ].includes(name) || + name.startsWith('dist-') || + name === 'playwright-report' || + name === 'routeTree.gen.ts' + ) { + continue + } + const file = path.join(dir, name) + if (statSync(file).isDirectory()) { + visit(file) + } else { + hash + .update(path.relative(directory, file)) + .update('\0') + .update(readFileSync(file)) + .update('\0') + } + } + } + visit(directory) + return hash.digest('hex') +} + +if (!worker) { + const samples = [] + for (let repetition = 0; repetition < repetitions; repetition++) { + const start = performance.now() + const result = spawnSync( + process.execPath, + [ + '--expose-gc', + fileURLToPath(import.meta.url), + '--worker', + '--workspace', + root, + '--app', + app, + ...(profile ? ['--profile'] : []), + ], + { + encoding: 'utf8', + maxBuffer: 32 * 1024 * 1024, + env: { ...process.env, NODE_ENV: 'production' }, + }, + ) + if (result.status !== 0) { + throw new Error(`Build failed: ${result.stderr}\n${result.stdout}`) + } + const line = result.stdout + .split('\n') + .find((candidate) => candidate.startsWith('BENCHMARK_JSON=')) + assert.ok(line, result.stdout) + const sample = JSON.parse(line.slice(15)) + if (samples.length) { + assert.equal( + sample.sourceHash, + samples[0].sourceHash, + 'App source changed during measurement', + ) + } + samples.push({ repetition, wallMs: performance.now() - start, ...sample }) + } + const median = (values) => + [...values].sort((a, b) => a - b)[Math.floor(values.length / 2)] + console.log( + JSON.stringify( + { + timestamp: new Date().toISOString(), + compilerFingerprint: compilerFingerprint(root), + node: process.version, + platform: process.platform, + arch: process.arch, + cpu: cpus()[0].model, + app, + repetitions, + profile, + summary: { + medianBuildMs: median(samples.map((sample) => sample.buildMs)), + minBuildMs: Math.min(...samples.map((sample) => sample.buildMs)), + maxBuildMs: Math.max(...samples.map((sample) => sample.buildMs)), + medianWallMs: median(samples.map((sample) => sample.wallMs)), + medianPeakRssMiB: median( + samples.map((sample) => sample.peakRssKiB / 1024), + ), + }, + samples, + }, + null, + 2, + ), + ) +} else { + process.chdir(appRoot) + const { createBuilder } = await import( + pathToFileURL(path.join(root, 'node_modules/vite/dist/node/index.js')) + ) + const hookTimings = {} + const instrumentation = { + name: 'compiler-benchmark-observer', + enforce: 'post', + configResolved(config) { + for (const plugin of config.plugins) { + if (!/tanstack|router|tsr/.test(plugin.name)) { + continue + } + for (const hookName of [ + 'buildStart', + 'load', + 'transform', + 'generateBundle', + ]) { + const hook = plugin[hookName] + if (!hook) { + continue + } + const original = typeof hook === 'function' ? hook : hook.handler + const handler = async function (...parameters) { + const start = performance.now() + try { + return await original.apply(this, parameters) + } finally { + const key = `${plugin.name}:${hookName}` + const metric = (hookTimings[key] ??= { calls: 0, ms: 0 }) + metric.calls++ + metric.ms += performance.now() - start + } + } + plugin[hookName] = + typeof hook === 'function' ? handler : { ...hook, handler } + } + } + }, + } + global.gc() + const before = process.memoryUsage() + const start = performance.now() + const builder = await createBuilder({ + root: appRoot, + logLevel: 'silent', + plugins: profile ? [instrumentation] : [], + }) + await builder.buildApp() + const buildMs = performance.now() - start + const after = process.memoryUsage() + global.gc() + const retained = process.memoryUsage() + const outputDirectories = new Set( + Object.values(builder.environments).map((environment) => + path.resolve(appRoot, environment.config.build.outDir), + ), + ) + let emittedFiles = 0 + let emittedCodeBytes = 0 + const visited = new Set() + function collectOutput(directory) { + for (const name of readdirSync(directory)) { + const file = path.join(directory, name) + if (visited.has(file)) { + continue + } + visited.add(file) + if (statSync(file).isDirectory()) { + collectOutput(file) + } else { + emittedFiles++ + if (/\.[cm]?js$/.test(name)) { + emittedCodeBytes += statSync(file).size + } + } + } + } + for (const directory of outputDirectories) { + collectOutput(directory) + } + console.log( + `BENCHMARK_JSON=${JSON.stringify({ buildMs, sourceHash: sourceHash(appRoot), peakRssKiB: process.resourceUsage().maxRSS, before, after, retained, emittedFiles, emittedCodeBytes, hookTimings })}`, + ) +} diff --git a/benchmarks/compiler/hydrate-scaling.mjs b/benchmarks/compiler/hydrate-scaling.mjs new file mode 100644 index 00000000000..e55e1242e34 --- /dev/null +++ b/benchmarks/compiler/hydrate-scaling.mjs @@ -0,0 +1,151 @@ +import { compilerFingerprint } from './provenance.mjs' +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { createHash } from 'node:crypto' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const args = process.argv.slice(2) +function option(name, fallback) { + const index = args.indexOf(name) + return index === -1 ? fallback : args[index + 1] +} +const workspace = path.resolve( + option('--workspace', fileURLToPath(new URL('../../', import.meta.url))), +) +const repetitions = Number(option('--repetitions', '5')) +const iterations = Number(option('--iterations', '5')) +const sizes = option('--sizes', '10,100,500').split(',').map(Number) +const env = option('--env', 'client') +assert.ok(env === 'client' || env === 'server') +for (const number of [repetitions, iterations, ...sizes]) { + assert.ok(Number.isSafeInteger(number) && number > 0) +} +if (!args.includes('--worker')) { + const samples = [] + for (let repetition = 0; repetition < repetitions; repetition++) { + for (const size of sizes) { + const result = spawnSync( + process.execPath, + [ + '--expose-gc', + fileURLToPath(import.meta.url), + '--worker', + '--workspace', + workspace, + '--sizes', + String(size), + '--iterations', + String(iterations), + '--env', + env, + ], + { + encoding: 'utf8', + maxBuffer: 4 * 1024 * 1024, + env: { ...process.env, NODE_ENV: 'production' }, + }, + ) + assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`) + samples.push({ repetition, ...JSON.parse(result.stdout) }) + } + } + const median = (array) => + array.sort((a, b) => a - b)[Math.floor(array.length / 2)] + const summary = sizes.map((size) => { + const subset = samples.filter((sample) => sample.boundaries === size) + assert.ok( + subset.every((sample) => sample.sourceHash === subset[0].sourceHash), + ) + return { + boundaries: size, + medianCompileMs: median(subset.map((sample) => sample.msPerCompile)), + medianPeakRssMiB: median(subset.map((sample) => sample.peakRssMiB)), + } + }) + console.log( + JSON.stringify( + { + timestamp: new Date().toISOString(), + compilerFingerprint: compilerFingerprint(workspace), + workspace, + node: process.version, + env, + repetitions, + iterations, + summary, + samples, + }, + null, + 2, + ), + ) +} else { + const boundaries = sizes[0] + const entry = (relative) => + pathToFileURL( + path.join(workspace, 'packages/start-plugin-core/dist/esm', relative), + ).href + const { createStartCompiler } = await import(entry('start-compiler/host.js')) + const { createHydrateCompilerPlugin } = await import( + entry('hydrate-when-transform.js') + ) + const code = `import { Hydrate } from '@tanstack/react-start'; +import { visible } from '@tanstack/react-start/hydration'; +${Array.from({ length: boundaries }, (_, index) => `const props${index} = { when: visible(), fallback: Loading ${index} };`).join('\n')} +function Widget({ value }: { value: number }) { return } +export function Page() { return
${Array.from({ length: boundaries }, (_, index) => ``).join('\n')}
} +` + let outputBytes = 0 + async function compile() { + const plugin = createHydrateCompilerPlugin() + const compiler = createStartCompiler({ + env, + envName: env === 'client' ? 'client' : 'ssr', + root: '/compiler-benchmark', + framework: 'react', + providerEnvName: 'ssr', + mode: 'build', + compilerPlugins: [plugin], + getKnownServerFns: () => ({}), + resolveId: async () => null, + loadModule: async (id) => { + throw new Error(`Unexpected module load: ${id}`) + }, + }) + const result = await compiler.compile({ + id: '/compiler-benchmark/route.tsx', + code, + }) + assert.ok(result) + if (env === 'client') { + assert.equal(result.code.match(/tss-hydrate=/g)?.length, boundaries) + } else { + assert.ok(!result.code.includes('Loading ')) + } + outputBytes += + Buffer.byteLength(result.code) + + Buffer.byteLength(JSON.stringify(result.map)) + } + await compile() + global.gc() + const before = process.memoryUsage() + const start = performance.now() + for (let index = 0; index < iterations; index++) { + await compile() + } + const elapsedMs = performance.now() - start + global.gc() + console.log( + JSON.stringify({ + boundaries, + sourceBytes: Buffer.byteLength(code), + sourceHash: createHash('sha256').update(code).digest('hex'), + msPerCompile: elapsedMs / iterations, + peakRssMiB: process.resourceUsage().maxRSS / 1024, + before, + retained: process.memoryUsage(), + outputBytes, + }), + ) +} diff --git a/benchmarks/compiler/measure.mjs b/benchmarks/compiler/measure.mjs new file mode 100644 index 00000000000..f6a6fc65f19 --- /dev/null +++ b/benchmarks/compiler/measure.mjs @@ -0,0 +1,446 @@ +import { compilerFingerprint } from './provenance.mjs' +import assert from 'node:assert/strict' +import { createHash } from 'node:crypto' +import { readFileSync, readdirSync } from 'node:fs' +import { createRequire } from 'node:module' +import { cpus } from 'node:os' +import path from 'node:path' +import { spawnSync } from 'node:child_process' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const defaultWorkspace = fileURLToPath(new URL('../../', import.meta.url)) +const args = process.argv.slice(2) +const option = (name, fallback) => { + const index = args.indexOf(name) + return index === -1 ? fallback : args[index + 1] +} +const root = path.resolve(option('--workspace', defaultWorkspace)) +const fixturesRoot = path.resolve(option('--fixtures-root', root)) +const bindings = Number(option('--bindings', '0')) +assert.ok(Number.isSafeInteger(bindings) && bindings >= 0) +const repetitions = Number(option('--repetitions', '5')) +const iterations = Number(option('--iterations', '20')) +const warmups = Number(option('--warmups', '2')) +const mode = option('--worker', '') +const digestOutput = args.includes('--digest-output') +const yukuRoot = option('--yuku-root', path.join(root, 'packages/router-utils')) +for (const [name, value] of Object.entries({ + repetitions, + iterations, + warmups, +})) { + assert.ok( + Number.isSafeInteger(value) && value >= (name === 'warmups' ? 0 : 1), + `${name} must be a valid integer`, + ) +} +const modes = option('--modes', 'yuku-roundtrip,yuku-splitter').split(',') +const fixtures = + bindings > 0 + ? [ + { + framework: 'react', + filename: 'react/shared-destructuring.tsx', + code: `import { createFileRoute } from '@tanstack/react-router'; +const { ${Array.from({ length: bindings }, (_, index) => `value${index}`).join(',')} } = { ${Array.from({ length: bindings }, (_, index) => `value${index}: ${index}`).join(',')} }; +const loader = () => [${Array.from({ length: bindings }, (_, index) => `value${index}`).join(',')}]; +const Component = () =>
{[${Array.from({ length: bindings }, (_, index) => `value${index}`).join(',')}].join(',')}
; +export const Route = createFileRoute('/wide')({ loader, component: Component });`, + }, + ] + : ['react', 'solid'].flatMap((framework) => { + const directory = path.join( + fixturesRoot, + 'packages/router-plugin/tests/code-splitter/test-files', + framework, + ) + return readdirSync(directory) + .sort() + .filter((name) => /\.[jt]sx?$/.test(name)) + .map((name) => ({ + framework, + filename: `${framework}/${name}`, + code: readFileSync(path.join(directory, name), 'utf8'), + })) + }) +const fixtureHash = createHash('sha256') +for (const fixture of fixtures) { + fixtureHash + .update(fixture.filename) + .update('\0') + .update(fixture.code) + .update('\0') +} +const corpus = { + files: fixtures.length, + bytes: fixtures.reduce( + (sum, fixture) => sum + Buffer.byteLength(fixture.code), + 0, + ), + sha256: fixtureHash.digest('hex'), +} + +if (!mode) { + const samples = [] + for (let repetition = 0; repetition < repetitions; repetition++) { + // Rotate order to reduce systematic temperature/background-work bias. + for (let index = 0; index < modes.length; index++) { + const selectedMode = modes[(index + repetition) % modes.length] + const start = performance.now() + const result = spawnSync( + process.execPath, + [ + '--expose-gc', + fileURLToPath(import.meta.url), + '--worker', + selectedMode, + '--workspace', + root, + '--fixtures-root', + fixturesRoot, + '--iterations', + String(iterations), + '--bindings', + String(bindings), + '--warmups', + String(warmups), + '--yuku-root', + yukuRoot, + ...(digestOutput ? ['--digest-output'] : []), + ], + { + encoding: 'utf8', + maxBuffer: 16 * 1024 * 1024, + env: { ...process.env, NODE_ENV: 'production' }, + }, + ) + if (result.status !== 0) { + throw new Error( + `${selectedMode} failed: ${result.stderr}\n${result.stdout}`, + ) + } + const line = result.stdout + .split('\n') + .find((value) => value.startsWith('BENCHMARK_JSON=')) + assert.ok(line, `${selectedMode} did not emit its result`) + const sample = JSON.parse(line.slice(15)) + assert.equal( + sample.corpus.sha256, + corpus.sha256, + 'Fixture corpus changed during measurement', + ) + samples.push({ + repetition, + wallMs: performance.now() - start, + ...sample, + }) + } + } + const median = (values) => + [...values].sort((a, b) => a - b)[Math.floor(values.length / 2)] + const summary = Object.fromEntries( + modes.map((selectedMode) => { + const selected = samples.filter((sample) => sample.mode === selectedMode) + return [ + selectedMode, + { + medianMsPerCorpus: median( + selected.map((sample) => sample.elapsedMs / iterations), + ), + minMsPerCorpus: Math.min( + ...selected.map((sample) => sample.elapsedMs / iterations), + ), + maxMsPerCorpus: Math.max( + ...selected.map((sample) => sample.elapsedMs / iterations), + ), + medianPeakRssMiB: median( + selected.map((sample) => sample.peakRssKiB / 1024), + ), + medianRetainedHeapMiB: median( + selected.map((sample) => sample.retained.heapUsed / 1024 ** 2), + ), + medianWallMs: median(selected.map((sample) => sample.wallMs)), + phasesMsPerCorpus: Object.fromEntries( + Object.keys(selected[0].phases).map((phase) => [ + phase, + median( + selected.map((sample) => sample.phases[phase] / iterations), + ), + ]), + ), + countsPerCorpus: selected[0].counts, + }, + ] + }), + ) + console.log( + JSON.stringify( + { + timestamp: new Date().toISOString(), + compilerFingerprint: compilerFingerprint(root), + workspace: root, + fixturesRoot, + node: process.version, + platform: process.platform, + arch: process.arch, + cpu: cpus()[0].model, + corpus, + repetitions, + iterations, + diagnosticOnly: digestOutput, + warmups, + summary, + samples, + }, + null, + 2, + ), + ) +} else { + const phases = {} + const counts = {} + let outputBytes = 0 + let outputMapBytes = 0 + const outputDigest = digestOutput ? createHash('sha256') : null + let resolvedReferences = 0 + let measuring = false + const time = (phase, operation) => { + const start = performance.now() + const value = operation() + if (measuring) { + phases[phase] = (phases[phase] ?? 0) + performance.now() - start + } + return value + } + const count = (name, amount = 1) => { + if (measuring) { + counts[name] = (counts[name] ?? 0) + amount + } + } + const consume = (result) => { + outputBytes += Buffer.byteLength(result.code) + assert.ok(result.map, 'Expected source map') + const map = JSON.stringify(result.map) + outputMapBytes += Buffer.byteLength(map) + outputDigest?.update(result.code).update('\0').update(map).update('\0') + count('outputs') + } + let execute + if (mode === 'yuku-roundtrip') { + assert.ok( + yukuRoot, + 'Supply --yuku-root pointing at a directory with Yuku 0.11.0 installed', + ) + const { analyze } = await import( + pathToFileURL(path.join(yukuRoot, 'node_modules/yuku-analyzer/index.js')) + ) + const { generate } = await import( + pathToFileURL(path.join(yukuRoot, 'node_modules/yuku-codegen/index.js')) + ) + execute = () => { + for (const { code, filename } of fixtures) { + const module = time('parseAnalyzeAndDecode', () => { + const result = analyze(code, { path: filename, attachComments: true }) + assert.equal(result.diagnostics.length, 0) + // The generator consumes the complete lazily decoded AST below. + void result.ast + return result + }) + count('parses') + time('semanticQueries', () => { + for (const reference of module.references) { + if (reference.symbol) { + resolvedReferences += reference.symbol.name.length + } + } + }) + consume( + time('generate', () => { + const result = generate(module.ast, { + comments: 'all', + sourceMap: { + source: code, + sourceFileName: filename, + sourcesContent: code, + }, + }) + assert.equal(result.errors.length, 0) + return result + }), + ) + } + } + } else { + const utils = await import( + pathToFileURL(path.join(root, 'packages/router-utils/dist/esm/index.js')) + ) + if (mode === 'babel-roundtrip') { + const require = createRequire( + path.join(root, 'packages/router-plugin/package.json'), + ) + const babel = require('@babel/core') + const generate = createRequire( + path.join(root, 'packages/router-utils/package.json'), + )('@babel/generator').default + execute = () => { + for (const { code, filename } of fixtures) { + const ast = time('parse', () => utils.parseAst({ code, filename })) + count('parses') + time('scopeAnalysis', () => + babel.traverse(ast, { + ReferencedIdentifier(identifier) { + const binding = identifier.scope.getBinding( + identifier.node.name, + ) + if (binding) { + resolvedReferences += binding.identifier.name.length + } + }, + }), + ) + consume( + time('generate', () => + generate( + ast, + { + filename, + sourceFileName: filename, + sourceMaps: true, + importAttributesKeyword: 'with', + }, + code, + ), + ), + ) + } + } + } else { + assert.ok( + ['babel-splitter', 'yuku-splitter', 'yuku-splitter-no-reuse'].includes( + mode, + ), + ) + const compiler = await import( + pathToFileURL( + path.join( + root, + 'packages/router-plugin/dist/esm/core/code-splitter/compilers.js', + ), + ) + ) + const groupings = [ + [['component'], ['errorComponent'], ['notFoundComponent']], + [ + ['loader'], + [ + 'component', + 'pendingComponent', + 'errorComponent', + 'notFoundComponent', + ], + ], + [ + ['loader', 'component', 'pendingComponent', 'notFoundComponent'], + ['errorComponent'], + ], + ] + execute = () => { + for (const { code, filename, framework } of fixtures) { + for (const fallback of groupings) { + const analysis = + mode === 'yuku-splitter' + ? time('parseAnalyze', () => + compiler.analyzeRouteModule({ code, filename }), + ) + : undefined + if (analysis) { + count('parses') + } + const detected = time('detectGroupings', () => + compiler.detectCodeSplitGroupingsFromRoute({ + code, + filename, + analysis, + }), + ) + count('parses', mode === 'yuku-splitter' ? 0 : 1) + const codeSplitGroupings = detected.groupings ?? fallback + const sharedBindings = time('sharedAnalysis', () => + compiler.computeSharedBindings({ + code, + analysis, + filename, + codeSplitGroupings, + }), + ) + count('parses', mode === 'yuku-splitter' ? 0 : 1) + const shared = sharedBindings.size > 0 ? sharedBindings : undefined + const reference = time('referenceCompile', () => + compiler.compileCodeSplitReferenceRoute({ + code, + analysis, + filename, + id: filename, + addHmr: false, + codeSplitGroupings, + targetFramework: framework, + sharedBindings: shared, + }), + ) + count('parses', mode === 'yuku-splitter' ? 0 : 1) + if (reference) { + consume(reference) + } else { + count('unchangedReferences') + } + for (const splitTargets of codeSplitGroupings) { + consume( + time('virtualCompile', () => + compiler.compileCodeSplitVirtualRoute({ + code, + analysis, + filename: `${filename}?tsr-split=${splitTargets.join('---')}`, + splitTargets, + sharedBindings: shared, + }), + ), + ) + count('parses', mode === 'yuku-splitter' ? 0 : 1) + } + if (shared) { + consume( + time('sharedCompile', () => + compiler.compileCodeSplitSharedRoute({ + code, + analysis, + filename: `${filename}?tsr-shared=1`, + sharedBindings, + }), + ), + ) + count('parses', mode === 'yuku-splitter' ? 0 : 1) + count('sharedModules') + } + } + } + } + } + } + for (let index = 0; index < warmups; index++) { + execute() + } + global.gc() + const before = process.memoryUsage() + measuring = true + const start = performance.now() + for (let index = 0; index < iterations; index++) { + execute() + } + const elapsedMs = performance.now() - start + const after = process.memoryUsage() + global.gc() + const retained = process.memoryUsage() + console.log( + `BENCHMARK_JSON=${JSON.stringify({ mode, corpus, elapsedMs, phases, counts: Object.fromEntries(Object.entries(counts).map(([name, value]) => [name, value / iterations])), peakRssKiB: process.resourceUsage().maxRSS, before, after, retained, outputBytes, outputMapBytes, resolvedReferences, ...(outputDigest ? { outputDigest: outputDigest.digest('hex'), diagnosticOnly: true } : {}) })}`, + ) +} diff --git a/benchmarks/compiler/process-tree.mjs b/benchmarks/compiler/process-tree.mjs new file mode 100644 index 00000000000..c28cc2b5c7f --- /dev/null +++ b/benchmarks/compiler/process-tree.mjs @@ -0,0 +1,116 @@ +import assert from 'node:assert/strict' +import { spawn, spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' + +// Separate diagnostic run: ps sampling deliberately stays outside speed runs. +const args = process.argv.slice(2) +const script = args.shift() +assert.ok( + script, + 'Usage: node process-tree.mjs [args]', +) +const child = spawn( + process.execPath, + [ + '--expose-gc', + fileURLToPath(new URL(script, import.meta.url)), + '--worker', + ...args, + ], + { + env: { ...process.env, NODE_ENV: 'production' }, + stdio: ['ignore', 'pipe', 'pipe'], + }, +) +let stdout = '' +let stderr = '' +child.stdout.on('data', (data) => { + stdout += data +}) +child.stderr.on('data', (data) => { + stderr += data +}) +let peakTreeKiB = 0 +let peakRootKiB = 0 +let samples = 0 +const descendants = new Map() +function sample() { + const result = spawnSync('ps', ['-Ao', 'pid=,ppid=,rss=,comm='], { + encoding: 'utf8', + }) + assert.equal(result.status, 0, result.stderr) + const processes = result.stdout + .trim() + .split('\n') + .map((line) => { + const match = line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) + return ( + match && { + pid: Number(match[1]), + parent: Number(match[2]), + rss: Number(match[3]), + command: match[4], + } + ) + }) + .filter(Boolean) + const included = new Set([child.pid]) + let previousSize + do { + previousSize = included.size + for (const process of processes) { + if (included.has(process.parent)) { + included.add(process.pid) + } + } + } while (included.size !== previousSize) + let rss = 0 + for (const process of processes) { + if (!included.has(process.pid)) { + continue + } + rss += process.rss + if (process.pid === child.pid) { + peakRootKiB = Math.max(peakRootKiB, process.rss) + } else { + descendants.set(process.pid, { + ...process, + peakRssKiB: Math.max( + descendants.get(process.pid)?.peakRssKiB ?? 0, + process.rss, + ), + }) + } + } + peakTreeKiB = Math.max(peakTreeKiB, rss) + samples++ +} +sample() +const timer = setInterval(sample, 50) +const status = await new Promise((resolve, reject) => { + child.once('error', reject) + child.once('close', resolve) +}) +clearInterval(timer) +assert.equal(status, 0, `${stdout}\n${stderr}`) +const line = stdout + .split('\n') + .find((entry) => entry.startsWith('BENCHMARK_JSON=')) +assert.ok(line, stdout) +console.log( + JSON.stringify( + { + timestamp: new Date().toISOString(), + node: process.version, + diagnosticOnly: true, + sampleIntervalMs: 50, + samples, + peakTreeMiB: peakTreeKiB / 1024, + peakRootMiB: peakRootKiB / 1024, + descendants: [...descendants.values()], + worker: JSON.parse(line.slice(15)), + }, + null, + 2, + ), +) diff --git a/benchmarks/compiler/provenance.mjs b/benchmarks/compiler/provenance.mjs new file mode 100644 index 00000000000..5bc3ee35a04 --- /dev/null +++ b/benchmarks/compiler/provenance.mjs @@ -0,0 +1,98 @@ +import { createHash } from 'node:crypto' +import { spawnSync } from 'node:child_process' +import { readFileSync, readdirSync } from 'node:fs' +import path from 'node:path' + +// Hash the executable compiler outputs actually consumed by workspace imports. +export function compilerFingerprint(workspace) { + const hash = createHash('sha256') + const sourceHash = createHash('sha256') + let files = 0 + let sourceFiles = 0 + for (const name of [ + 'router-utils', + 'router-generator', + 'router-plugin', + 'start-plugin-core', + ]) { + const sourceDirectory = path.join(workspace, 'packages', name, 'src') + for (const file of readdirSync(sourceDirectory, { recursive: true }) + .sort() + .filter((entry) => /\.[cm]?[jt]sx?$/.test(entry))) { + sourceHash + .update(`${name}/${file}\0`) + .update(readFileSync(path.join(sourceDirectory, file))) + .update('\0') + sourceFiles++ + } + sourceHash + .update(`${name}/package.json\0`) + .update( + readFileSync(path.join(workspace, 'packages', name, 'package.json')), + ) + .update('\0') + const directory = path.join(workspace, 'packages', name, 'dist/esm') + let entries + try { + entries = readdirSync(directory, { recursive: true }) + } catch (error) { + if (error.code !== 'ENOENT') { + throw error + } + hash.update(`${name}:not-built`) + continue + } + for (const file of entries + .sort() + .filter((entry) => entry.endsWith('.js'))) { + hash + .update(`${name}/${file}\0`) + .update(readFileSync(path.join(directory, file))) + .update('\0') + files++ + } + } + const revision = spawnSync('git', ['rev-parse', 'HEAD'], { + cwd: workspace, + encoding: 'utf8', + }) + if (revision.status !== 0) { + throw new Error(revision.stderr) + } + const dependencyVersions = {} + for (const name of [ + 'yuku-analyzer', + 'yuku-ast', + 'yuku-codegen', + '@yuku-toolchain/types', + '@babel/core', + '@babel/generator', + '@babel/types', + ]) { + try { + dependencyVersions[name] = JSON.parse( + readFileSync( + path.join( + workspace, + 'packages/router-utils/node_modules', + name, + 'package.json', + ), + 'utf8', + ), + ).version + } catch (error) { + if (error.code !== 'ENOENT') { + throw error + } + } + } + return { + commit: revision.stdout.trim(), + sha256: hash.digest('hex'), + javascriptFiles: files, + sourceSha256: sourceHash.digest('hex'), + sourceFiles, + dependencyVersions, + } +} diff --git a/benchmarks/compiler/results/app-babel-baseline.json b/benchmarks/compiler/results/app-babel-baseline.json new file mode 100644 index 00000000000..c1cf8bbc9fc --- /dev/null +++ b/benchmarks/compiler/results/app-babel-baseline.json @@ -0,0 +1,174 @@ +{ + "timestamp": "2026-09-26T13:03:17.189Z", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-router/basic-file-based-code-splitting", + "repetitions": 5, + "profile": false, + "summary": { + "medianBuildMs": 394.354125, + "minBuildMs": 391.888125, + "maxBuildMs": 409.578667, + "medianWallMs": 514.3092079999999, + "medianPeakRssMiB": 290.3125 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 514.3092079999999, + "buildMs": 393.94629199999997, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 293360, + "before": { + "rss": 88817664, + "heapTotal": 24363008, + "heapUsed": 14162496, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 298696704, + "heapTotal": 128106496, + "heapUsed": 71259712, + "external": 5185922, + "arrayBuffers": 227152 + }, + "retained": { + "rss": 290996224, + "heapTotal": 118571008, + "heapUsed": 47370912, + "external": 5185922, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": {} + }, + { + "repetition": 1, + "wallMs": 524.6586249999999, + "buildMs": 409.578667, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 296768, + "before": { + "rss": 88834048, + "heapTotal": 25149440, + "heapUsed": 14163424, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 302546944, + "heapTotal": 128892928, + "heapUsed": 71324584, + "external": 5169538, + "arrayBuffers": 210768 + }, + "retained": { + "rss": 294649856, + "heapTotal": 118833152, + "heapUsed": 47364760, + "external": 5169538, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": {} + }, + { + "repetition": 2, + "wallMs": 530.3969999999999, + "buildMs": 405.341708, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 297280, + "before": { + "rss": 89473024, + "heapTotal": 24625152, + "heapUsed": 14180440, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 304283648, + "heapTotal": 133611520, + "heapUsed": 60882408, + "external": 5081453, + "arrayBuffers": 122683 + }, + "retained": { + "rss": 295157760, + "heapTotal": 118833152, + "heapUsed": 47359048, + "external": 5081453, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": {} + }, + { + "repetition": 3, + "wallMs": 511.7426250000001, + "buildMs": 391.888125, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 298000, + "before": { + "rss": 88768512, + "heapTotal": 24100864, + "heapUsed": 14178776, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 303693824, + "heapTotal": 128106496, + "heapUsed": 71527056, + "external": 5169538, + "arrayBuffers": 210768 + }, + "retained": { + "rss": 295911424, + "heapTotal": 118571008, + "heapUsed": 47360272, + "external": 5169538, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": {} + }, + { + "repetition": 4, + "wallMs": 510.90170799999987, + "buildMs": 394.354125, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 302784, + "before": { + "rss": 88915968, + "heapTotal": 24100864, + "heapUsed": 14163048, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 308920320, + "heapTotal": 129417216, + "heapUsed": 71051128, + "external": 5168738, + "arrayBuffers": 209968 + }, + "retained": { + "rss": 300646400, + "heapTotal": 118833152, + "heapUsed": 47409424, + "external": 5168738, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": {} + } + ] +} diff --git a/benchmarks/compiler/results/app-babel-profile.json b/benchmarks/compiler/results/app-babel-profile.json new file mode 100644 index 00000000000..f7f0faf8f32 --- /dev/null +++ b/benchmarks/compiler/results/app-babel-profile.json @@ -0,0 +1,83 @@ +{ + "timestamp": "2026-09-26T13:03:17.738Z", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-router/basic-file-based-code-splitting", + "repetitions": 1, + "profile": true, + "summary": { + "medianBuildMs": 399.16337500000003, + "minBuildMs": 399.16337500000003, + "maxBuildMs": 399.16337500000003, + "medianWallMs": 522.097459, + "medianPeakRssMiB": 283.640625 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 522.097459, + "buildMs": 399.16337500000003, + "sourceHash": "0c64f15b88b9fd42d89c99640724c7aeb3cf677af7f9316e7784b45ee9f5a0eb", + "peakRssKiB": 290448, + "before": { + "rss": 89653248, + "heapTotal": 24100864, + "heapUsed": 14180760, + "external": 3823837, + "arrayBuffers": 36007 + }, + "after": { + "rss": 296239104, + "heapTotal": 130203648, + "heapUsed": 63776384, + "external": 5030243, + "arrayBuffers": 84508 + }, + "retained": { + "rss": 288178176, + "heapTotal": 117260288, + "heapUsed": 47292680, + "external": 5030243, + "arrayBuffers": 77577 + }, + "emittedFiles": 16, + "emittedCodeBytes": 277550, + "hookTimings": { + "tanstack:router-generator:buildStart": { + "calls": 1, + "ms": 0.039332999999999174 + }, + "tanstack-router:code-splitter:compile-reference-file:buildStart": { + "calls": 1, + "ms": 0.00925000000000864 + }, + "tanstack-router:code-splitter:compile-virtual-file:buildStart": { + "calls": 1, + "ms": 0.008249999999975444 + }, + "tanstack-router:code-splitter:compile-shared-file:buildStart": { + "calls": 1, + "ms": 0.007375000000024556 + }, + "tanstack:router-inline-css-defaults:buildStart": { + "calls": 1, + "ms": 0.008082999999999174 + }, + "tanstack-router:code-splitter:compile-reference-file:transform": { + "calls": 14, + "ms": 32.28116699999981 + }, + "tanstack-router:code-splitter:compile-virtual-file:transform": { + "calls": 13, + "ms": 13.803124000000025 + }, + "tanstack-router:code-splitter:compile-shared-file:transform": { + "calls": 1, + "ms": 2.099084000000005 + } + } + } + ] +} diff --git a/benchmarks/compiler/results/babel-yuku-0.11.0.json b/benchmarks/compiler/results/babel-yuku-0.11.0.json new file mode 100644 index 00000000000..727092561e9 --- /dev/null +++ b/benchmarks/compiler/results/babel-yuku-0.11.0.json @@ -0,0 +1,769 @@ +{ + "timestamp": "2026-09-26T12:59:12.446Z", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "repetitions": 5, + "iterations": 20, + "warmups": 2, + "summary": { + "babel-roundtrip": { + "medianMsPerCorpus": 13.4799896, + "minMsPerCorpus": 13.24982915, + "maxMsPerCorpus": 13.798385450000001, + "medianPeakRssMiB": 302.578125, + "medianRetainedHeapMiB": 17.268569946289062, + "medianWallMs": 476.3332500000033, + "phasesMsPerCorpus": { + "parse": 3.225691699999911, + "scopeAnalysis": 7.217579950000053, + "generate": 2.454737450000027 + }, + "countsPerCorpus": { + "parses": 53, + "outputs": 53 + } + }, + "yuku-roundtrip": { + "medianMsPerCorpus": 4.9375625, + "minMsPerCorpus": 4.73834375, + "maxMsPerCorpus": 5.223325, + "medianPeakRssMiB": 146.5625, + "medianRetainedHeapMiB": 6.1072540283203125, + "medianWallMs": 176.7445000000007, + "phasesMsPerCorpus": { + "parseAnalyzeAndDecode": 2.249952150000003, + "semanticQueries": 0.16668975000000472, + "generate": 2.3542568500000156 + }, + "countsPerCorpus": { + "parses": 53, + "outputs": 53 + } + }, + "babel-splitter": { + "medianMsPerCorpus": 302.4294458, + "minMsPerCorpus": 299.19393959999996, + "maxMsPerCorpus": 313.71834585, + "medianPeakRssMiB": 404.515625, + "medianRetainedHeapMiB": 22.966278076171875, + "medianWallMs": 7007.919875, + "phasesMsPerCorpus": { + "detectGroupings": 25.88697410000059, + "sharedAnalysis": 21.433474900000327, + "referenceCompile": 112.0296313999991, + "virtualCompile": 134.72874154999676, + "sharedCompile": 8.196722899999894 + }, + "countsPerCorpus": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 527.670917, + "mode": "babel-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 275.967709, + "phases": { + "parse": 64.51383399999821, + "scopeAnalysis": 156.850171000001, + "generate": 45.687306999999976 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 310304, + "before": { + "rss": 141148160, + "heapTotal": 55558144, + "heapUsed": 15769288, + "external": 2383414, + "arrayBuffers": 24947 + }, + "after": { + "rss": 316801024, + "heapTotal": 175636480, + "heapUsed": 49436376, + "external": 4709982, + "arrayBuffers": 2400627 + }, + "retained": { + "rss": 316866560, + "heapTotal": 157024256, + "heapUsed": 18115664, + "external": 4709982, + "arrayBuffers": 24947 + }, + "outputBytes": 947650, + "outputMapBytes": 2006730, + "resolvedReferences": 70554 + }, + { + "repetition": 0, + "wallMs": 185.95804099999998, + "mode": "yuku-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 104.4665, + "phases": { + "parseAnalyzeAndDecode": 49.241157000000186, + "semanticQueries": 3.3337950000000944, + "generate": 48.93699999999964 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 152096, + "before": { + "rss": 80117760, + "heapTotal": 16875520, + "heapUsed": 6173064, + "external": 3805968, + "arrayBuffers": 24819 + }, + "after": { + "rss": 155664384, + "heapTotal": 49643520, + "heapUsed": 23903168, + "external": 10279107, + "arrayBuffers": 8042154 + }, + "retained": { + "rss": 155680768, + "heapTotal": 45187072, + "heapUsed": 6397768, + "external": 10279107, + "arrayBuffers": 7353748 + }, + "outputBytes": 709962, + "outputMapBytes": 1543718, + "resolvedReferences": 70752 + }, + { + "repetition": 0, + "wallMs": 7007.919875, + "mode": "babel-splitter", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 6048.588916, + "phases": { + "detectGroupings": 532.4590809999818, + "sharedAnalysis": 436.8084649999955, + "referenceCompile": 2207.824823000019, + "virtualCompile": 2694.5748309999353, + "sharedCompile": 153.560947999993 + }, + "counts": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + }, + "peakRssKiB": 414576, + "before": { + "rss": 326205440, + "heapTotal": 189792256, + "heapUsed": 22876880, + "external": 2711430, + "arrayBuffers": 24947 + }, + "after": { + "rss": 424525824, + "heapTotal": 282722304, + "heapUsed": 163560120, + "external": 2428974, + "arrayBuffers": 123251 + }, + "retained": { + "rss": 424525824, + "heapTotal": 249430016, + "heapUsed": 24074312, + "external": 2428974, + "arrayBuffers": 24947 + }, + "outputBytes": 3183180, + "outputMapBytes": 13135804, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 168.65099999999984, + "mode": "yuku-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 98.75125, + "phases": { + "parseAnalyzeAndDecode": 40.83916700000009, + "semanticQueries": 3.359765999999979, + "generate": 51.629963000000544 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 150080, + "before": { + "rss": 79888384, + "heapTotal": 16875520, + "heapUsed": 6173112, + "external": 3805968, + "arrayBuffers": 24819 + }, + "after": { + "rss": 153616384, + "heapTotal": 49381376, + "heapUsed": 23903256, + "external": 10322182, + "arrayBuffers": 8085229 + }, + "retained": { + "rss": 153632768, + "heapTotal": 44924928, + "heapUsed": 6397816, + "external": 10322182, + "arrayBuffers": 7389521 + }, + "outputBytes": 709962, + "outputMapBytes": 1543718, + "resolvedReferences": 70752 + }, + { + "repetition": 1, + "wallMs": 7204.366458, + "mode": "babel-splitter", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 6274.366916999999, + "phases": { + "detectGroupings": 528.1172790000055, + "sharedAnalysis": 431.34651300001406, + "referenceCompile": 2240.592627999982, + "virtualCompile": 2859.524886000012, + "sharedCompile": 189.860152999996 + }, + "counts": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + }, + "peakRssKiB": 414160, + "before": { + "rss": 323731456, + "heapTotal": 190054400, + "heapUsed": 22874632, + "external": 2711778, + "arrayBuffers": 24947 + }, + "after": { + "rss": 424099840, + "heapTotal": 282722304, + "heapUsed": 169873168, + "external": 2543662, + "arrayBuffers": 237939 + }, + "retained": { + "rss": 424099840, + "heapTotal": 252051456, + "heapUsed": 24080728, + "external": 2543662, + "arrayBuffers": 24947 + }, + "outputBytes": 3183180, + "outputMapBytes": 13135804, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 484.5921670000007, + "mode": "babel-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 272.68766600000004, + "phases": { + "parse": 68.84969000000069, + "scopeAnalysis": 144.35159900000104, + "generate": 50.77574399999844 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 309840, + "before": { + "rss": 137478144, + "heapTotal": 55296000, + "heapUsed": 15754712, + "external": 2383414, + "arrayBuffers": 24947 + }, + "after": { + "rss": 316309504, + "heapTotal": 176160768, + "heapUsed": 47755376, + "external": 4513374, + "arrayBuffers": 2204019 + }, + "retained": { + "rss": 316391424, + "heapTotal": 157024256, + "heapUsed": 18127400, + "external": 4513374, + "arrayBuffers": 24947 + }, + "outputBytes": 947650, + "outputMapBytes": 2006730, + "resolvedReferences": 70554 + }, + { + "repetition": 2, + "wallMs": 6926.899791999998, + "mode": "babel-splitter", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 6026.696583, + "phases": { + "detectGroupings": 517.7394820000118, + "sharedAnalysis": 428.66949800000657, + "referenceCompile": 2170.635497999957, + "virtualCompile": 2733.4160990000028, + "sharedCompile": 152.50371699999414 + }, + "counts": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + }, + "peakRssKiB": 415152, + "before": { + "rss": 311951360, + "heapTotal": 190054400, + "heapUsed": 21764608, + "external": 2514486, + "arrayBuffers": 24947 + }, + "after": { + "rss": 424984576, + "heapTotal": 283246592, + "heapUsed": 184646752, + "external": 2759390, + "arrayBuffers": 453667 + }, + "retained": { + "rss": 424984576, + "heapTotal": 248905728, + "heapUsed": 24095688, + "external": 2759390, + "arrayBuffers": 24947 + }, + "outputBytes": 3183180, + "outputMapBytes": 13135804, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 471.55358400000114, + "mode": "babel-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 264.996583, + "phases": { + "parse": 61.84003300000023, + "scopeAnalysis": 131.1967770000008, + "generate": 63.49294199999866 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 304208, + "before": { + "rss": 125517824, + "heapTotal": 53460992, + "heapUsed": 15747416, + "external": 3087926, + "arrayBuffers": 24947 + }, + "after": { + "rss": 310558720, + "heapTotal": 180617216, + "heapUsed": 52187488, + "external": 4972126, + "arrayBuffers": 2662771 + }, + "retained": { + "rss": 310624256, + "heapTotal": 157548544, + "heapUsed": 18094472, + "external": 4972126, + "arrayBuffers": 24947 + }, + "outputBytes": 947650, + "outputMapBytes": 2006730, + "resolvedReferences": 70554 + }, + { + "repetition": 2, + "wallMs": 163.33804200000304, + "mode": "yuku-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 94.766875, + "phases": { + "parseAnalyzeAndDecode": 42.89091699999943, + "semanticQueries": 3.2284670000001086, + "generate": 46.014955000000015 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 149696, + "before": { + "rss": 79937536, + "heapTotal": 16875520, + "heapUsed": 6173064, + "external": 3805968, + "arrayBuffers": 24819 + }, + "after": { + "rss": 153190400, + "heapTotal": 49905664, + "heapUsed": 23763792, + "external": 10090687, + "arrayBuffers": 7853734 + }, + "retained": { + "rss": 153206784, + "heapTotal": 45449216, + "heapUsed": 6403920, + "external": 10090687, + "arrayBuffers": 7195241 + }, + "outputBytes": 709962, + "outputMapBytes": 1543718, + "resolvedReferences": 70752 + }, + { + "repetition": 3, + "wallMs": 476.3332500000033, + "mode": "babel-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 269.599792, + "phases": { + "parse": 58.63953399999997, + "scopeAnalysis": 148.80662899999982, + "generate": 49.09474900000055 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 299184, + "before": { + "rss": 126746624, + "heapTotal": 56082432, + "heapUsed": 15732928, + "external": 2383414, + "arrayBuffers": 24947 + }, + "after": { + "rss": 305414144, + "heapTotal": 179044352, + "heapUsed": 47672848, + "external": 4513374, + "arrayBuffers": 2204019 + }, + "retained": { + "rss": 305528832, + "heapTotal": 157024256, + "heapUsed": 18107408, + "external": 4513374, + "arrayBuffers": 24947 + }, + "outputBytes": 947650, + "outputMapBytes": 2006730, + "resolvedReferences": 70554 + }, + { + "repetition": 3, + "wallMs": 176.7445000000007, + "mode": "yuku-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 97.923833, + "phases": { + "parseAnalyzeAndDecode": 44.99904300000006, + "semanticQueries": 3.2163849999998035, + "generate": 47.085137000000316 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 148304, + "before": { + "rss": 79855616, + "heapTotal": 17137664, + "heapUsed": 6173064, + "external": 3805968, + "arrayBuffers": 24819 + }, + "after": { + "rss": 151371776, + "heapTotal": 48594944, + "heapUsed": 24095776, + "external": 10582420, + "arrayBuffers": 8345467 + }, + "retained": { + "rss": 151863296, + "heapTotal": 45711360, + "heapUsed": 6476128, + "external": 10582420, + "arrayBuffers": 7658699 + }, + "outputBytes": 709962, + "outputMapBytes": 1543718, + "resolvedReferences": 70752 + }, + { + "repetition": 3, + "wallMs": 6881.246666000003, + "mode": "babel-splitter", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 5983.8787919999995, + "phases": { + "detectGroupings": 463.0925660000021, + "sharedAnalysis": 407.64046999998936, + "referenceCompile": 2329.0412220000435, + "virtualCompile": 2592.2006649999594, + "sharedCompile": 163.9344579999979 + }, + "counts": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + }, + "peakRssKiB": 414224, + "before": { + "rss": 322830336, + "heapTotal": 190054400, + "heapUsed": 22874096, + "external": 2711778, + "arrayBuffers": 24947 + }, + "after": { + "rss": 424148992, + "heapTotal": 284557312, + "heapUsed": 205903568, + "external": 3073782, + "arrayBuffers": 768059 + }, + "retained": { + "rss": 424165376, + "heapTotal": 250740736, + "heapUsed": 24084656, + "external": 3073782, + "arrayBuffers": 24947 + }, + "outputBytes": 3183180, + "outputMapBytes": 13135804, + "resolvedReferences": 0 + }, + { + "repetition": 4, + "wallMs": 188.23975000000064, + "mode": "yuku-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 103.526208, + "phases": { + "parseAnalyzeAndDecode": 50.378245000000106, + "semanticQueries": 3.4224100000000703, + "generate": 46.92224599999997 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 150656, + "before": { + "rss": 80117760, + "heapTotal": 17137664, + "heapUsed": 6173064, + "external": 3805968, + "arrayBuffers": 24819 + }, + "after": { + "rss": 150978560, + "heapTotal": 49119232, + "heapUsed": 23861720, + "external": 10478986, + "arrayBuffers": 8242033 + }, + "retained": { + "rss": 154238976, + "heapTotal": 45711360, + "heapUsed": 6481048, + "external": 10478986, + "arrayBuffers": 7563793 + }, + "outputBytes": 709962, + "outputMapBytes": 1543718, + "resolvedReferences": 70752 + }, + { + "repetition": 4, + "wallMs": 7087.465582999997, + "mode": "babel-splitter", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 6111.437540999999, + "phases": { + "detectGroupings": 470.0676770000082, + "sharedAnalysis": 395.2058989999905, + "referenceCompile": 2390.3221739999626, + "virtualCompile": 2641.020711000013, + "sharedCompile": 191.22954399999708 + }, + "counts": { + "parses": 877, + "outputs": 530, + "sharedModules": 29, + "unchangedReferences": 29 + }, + "peakRssKiB": 414032, + "before": { + "rss": 324075520, + "heapTotal": 191365120, + "heapUsed": 22874424, + "external": 2711430, + "arrayBuffers": 24947 + }, + "after": { + "rss": 423968768, + "heapTotal": 284295168, + "heapUsed": 205707112, + "external": 3073782, + "arrayBuffers": 768059 + }, + "retained": { + "rss": 423968768, + "heapTotal": 250740736, + "heapUsed": 24081888, + "external": 3073782, + "arrayBuffers": 24947 + }, + "outputBytes": 3183180, + "outputMapBytes": 13135804, + "resolvedReferences": 0 + }, + { + "repetition": 4, + "wallMs": 473.32004099999904, + "mode": "babel-roundtrip", + "corpus": { + "files": 53, + "bytes": 44062, + "sha256": "da62656bbcaca680edbfc1a206b9c47eec68bce9db11b9e631287b42b3f45539" + }, + "elapsedMs": 266.09725, + "phases": { + "parse": 65.38071300000081, + "scopeAnalysis": 141.11641599999967, + "generate": 46.57379300000042 + }, + "counts": { + "parses": 53, + "outputs": 53 + }, + "peakRssKiB": 311312, + "before": { + "rss": 125321216, + "heapTotal": 54247424, + "heapUsed": 15746360, + "external": 3055158, + "arrayBuffers": 24947 + }, + "after": { + "rss": 317833216, + "heapTotal": 183762944, + "heapUsed": 48516704, + "external": 4628062, + "arrayBuffers": 2318707 + }, + "retained": { + "rss": 317915136, + "heapTotal": 158597120, + "heapUsed": 18105368, + "external": 4628062, + "arrayBuffers": 24947 + }, + "outputBytes": 947650, + "outputMapBytes": 2006730, + "resolvedReferences": 70554 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-babel.json b/benchmarks/compiler/results/quiet-initial-babel.json new file mode 100644 index 00000000000..78603e690a3 --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-babel.json @@ -0,0 +1,341 @@ +{ + "timestamp": "2026-09-26T13:30:00.981Z", + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 3, + "iterations": 5, + "warmups": 2, + "summary": { + "babel-roundtrip": { + "medianMsPerCorpus": 19.676650000000006, + "minMsPerCorpus": 17.176666599999997, + "maxMsPerCorpus": 19.726800000000004, + "medianPeakRssMiB": 154.125, + "medianRetainedHeapMiB": 15.722442626953125, + "medianWallMs": 294.2931670000007, + "phasesMsPerCorpus": { + "parse": 6.174784999999917, + "scopeAnalysis": 8.490115200000037, + "generate": 4.422550399999875 + }, + "countsPerCorpus": { + "parses": 52, + "outputs": 52 + } + }, + "babel-splitter": { + "medianMsPerCorpus": 313.1599918, + "minMsPerCorpus": 311.01958320000006, + "maxMsPerCorpus": 316.4712166, + "medianPeakRssMiB": 385.71875, + "medianRetainedHeapMiB": 23.74852752685547, + "medianWallMs": 2414.6060829999997, + "phasesMsPerCorpus": { + "detectGroupings": 25.37127440000004, + "sharedAnalysis": 22.283281600000826, + "referenceCompile": 113.90413139999973, + "virtualCompile": 143.70433119999916, + "sharedCompile": 6.389016999999422 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 361.24899999999997, + "mode": "babel-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 98.63400000000001, + "phases": { + "parse": 30.873924999999588, + "scopeAnalysis": 42.808119999999576, + "generate": 22.112751999999375 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 161360, + "before": { + "rss": 135331840, + "heapTotal": 52674560, + "heapUsed": 15733800, + "external": 3087926, + "arrayBuffers": 24947 + }, + "after": { + "rss": 164921344, + "heapTotal": 98320384, + "heapUsed": 44687640, + "external": 2596446, + "arrayBuffers": 287091 + }, + "retained": { + "rss": 164806656, + "heapTotal": 92651520, + "heapUsed": 16486176, + "external": 2596446, + "arrayBuffers": 24947 + }, + "outputBytes": 295617, + "outputMapBytes": 623889, + "resolvedReferences": 21623 + }, + { + "repetition": 0, + "wallMs": 2404.3599169999998, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1555.0979160000002, + "phases": { + "detectGroupings": 122.01171400000158, + "sharedAnalysis": 113.70171499999924, + "referenceCompile": 569.5206569999987, + "virtualCompile": 707.8050290000028, + "sharedCompile": 31.384992000000693 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 394976, + "before": { + "rss": 303808512, + "heapTotal": 186646528, + "heapUsed": 21790512, + "external": 3208446, + "arrayBuffers": 24947 + }, + "after": { + "rss": 401375232, + "heapTotal": 222691328, + "heapUsed": 84572288, + "external": 2780102, + "arrayBuffers": 470747 + }, + "retained": { + "rss": 401506304, + "heapTotal": 178126848, + "heapUsed": 24901488, + "external": 2780102, + "arrayBuffers": 24947 + }, + "outputBytes": 980686, + "outputMapBytes": 4059118, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 2414.6060829999997, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1582.356083, + "phases": { + "detectGroupings": 134.88490699999738, + "sharedAnalysis": 111.41640800000414, + "referenceCompile": 574.5399920000064, + "virtualCompile": 718.5216559999958, + "sharedCompile": 36.52058199999874 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 394048, + "before": { + "rss": 301924352, + "heapTotal": 188743680, + "heapUsed": 22821120, + "external": 3274330, + "arrayBuffers": 24947 + }, + "after": { + "rss": 399933440, + "heapTotal": 221904896, + "heapUsed": 88263880, + "external": 2766250, + "arrayBuffers": 456895 + }, + "retained": { + "rss": 399982592, + "heapTotal": 177864704, + "heapUsed": 24902136, + "external": 2766250, + "arrayBuffers": 24947 + }, + "outputBytes": 980686, + "outputMapBytes": 4059118, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 294.2931670000007, + "mode": "babel-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 98.38325000000003, + "phases": { + "parse": 30.97932699999967, + "scopeAnalysis": 42.45057600000018, + "generate": 22.113213000000485 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 152224, + "before": { + "rss": 125566976, + "heapTotal": 52936704, + "heapUsed": 15731600, + "external": 3087926, + "arrayBuffers": 24947 + }, + "after": { + "rss": 155484160, + "heapTotal": 98844672, + "heapUsed": 44678160, + "external": 2596446, + "arrayBuffers": 287091 + }, + "retained": { + "rss": 155353088, + "heapTotal": 93175808, + "heapUsed": 16484200, + "external": 2596446, + "arrayBuffers": 24947 + }, + "outputBytes": 295617, + "outputMapBytes": 623889, + "resolvedReferences": 21623 + }, + { + "repetition": 2, + "wallMs": 286.4182090000004, + "mode": "babel-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 85.883333, + "phases": { + "parse": 21.45592200000027, + "scopeAnalysis": 41.178542000000334, + "generate": 20.444539999999904 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 157824, + "before": { + "rss": 126713856, + "heapTotal": 55296000, + "heapUsed": 15712048, + "external": 2350646, + "arrayBuffers": 24947 + }, + "after": { + "rss": 159809536, + "heapTotal": 93339648, + "heapUsed": 52101872, + "external": 3628638, + "arrayBuffers": 1319283 + }, + "retained": { + "rss": 161202176, + "heapTotal": 92389376, + "heapUsed": 16611112, + "external": 3628638, + "arrayBuffers": 24947 + }, + "outputBytes": 295617, + "outputMapBytes": 623889, + "resolvedReferences": 21623 + }, + { + "repetition": 2, + "wallMs": 2426.390416, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1565.799959, + "phases": { + "detectGroupings": 126.85637200000019, + "sharedAnalysis": 109.61446499999965, + "referenceCompile": 560.3654569999981, + "virtualCompile": 726.7680690000029, + "sharedCompile": 31.945084999997107 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 397408, + "before": { + "rss": 305184768, + "heapTotal": 190840832, + "heapUsed": 22823896, + "external": 3290714, + "arrayBuffers": 24947 + }, + "after": { + "rss": 403472384, + "heapTotal": 225574912, + "heapUsed": 84544256, + "external": 2796486, + "arrayBuffers": 487131 + }, + "retained": { + "rss": 403537920, + "heapTotal": 178651136, + "heapUsed": 24912400, + "external": 2796486, + "arrayBuffers": 24947 + }, + "outputBytes": 980686, + "outputMapBytes": 4059118, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-reuse.json b/benchmarks/compiler/results/quiet-initial-reuse.json new file mode 100644 index 00000000000..fbc486f7e2f --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-reuse.json @@ -0,0 +1,361 @@ +{ + "timestamp": "2026-09-26T13:32:29.357Z", + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 3, + "iterations": 5, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 100.46678339999998, + "minMsPerCorpus": 94.794675, + "maxMsPerCorpus": 106.3128834, + "medianPeakRssMiB": 186.484375, + "medianRetainedHeapMiB": 8.091773986816406, + "medianWallMs": 823.2411250000005, + "phasesMsPerCorpus": { + "parseAnalyze": 12.186983599999962, + "detectGroupings": 0.09169859999988147, + "sharedAnalysis": 1.8222826000002896, + "referenceCompile": 28.679641000000014, + "virtualCompile": 53.402994200000215, + "sharedCompile": 3.219966800000043 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + }, + "yuku-splitter-no-reuse": { + "medianMsPerCorpus": 140.6866416, + "minMsPerCorpus": 138.4159666, + "maxMsPerCorpus": 156.5373666, + "medianPeakRssMiB": 294.484375, + "medianRetainedHeapMiB": 8.130363464355469, + "medianWallMs": 1145.192959, + "phasesMsPerCorpus": { + "detectGroupings": 9.323899000000665, + "sharedAnalysis": 10.244848599999887, + "referenceCompile": 37.181582599999956, + "virtualCompile": 77.58609480000072, + "sharedCompile": 5.091000200000053 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 877.151833, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 531.564417, + "phases": { + "parseAnalyze": 63.390517999999474, + "detectGroupings": 1.2220519999995076, + "sharedAnalysis": 10.607583000000659, + "referenceCompile": 149.43272400000126, + "virtualCompile": 282.56369500000005, + "sharedCompile": 16.11187399999926 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 191312, + "before": { + "rss": 117669888, + "heapTotal": 46759936, + "heapUsed": 8581240, + "external": 5124626, + "arrayBuffers": 2833926 + }, + "after": { + "rss": 195805184, + "heapTotal": 92372992, + "heapUsed": 52999104, + "external": 13699581, + "arrayBuffers": 11408841 + }, + "retained": { + "rss": 195805184, + "heapTotal": 86081536, + "heapUsed": 8465576, + "external": 13699581, + "arrayBuffers": 11262325 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 0, + "wallMs": 1145.192959, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 703.433208, + "phases": { + "detectGroupings": 45.69733199999587, + "sharedAnalysis": 53.906956999999466, + "referenceCompile": 184.62775600000236, + "virtualCompile": 387.93047400000364, + "sharedCompile": 25.455001000000266 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 301552, + "before": { + "rss": 206766080, + "heapTotal": 79003648, + "heapUsed": 8848608, + "external": 9963235, + "arrayBuffers": 6199467 + }, + "after": { + "rss": 308772864, + "heapTotal": 184123392, + "heapUsed": 63661448, + "external": 18296091, + "arrayBuffers": 16005351 + }, + "retained": { + "rss": 308445184, + "heapTotal": 161054720, + "heapUsed": 8515104, + "external": 18296091, + "arrayBuffers": 15455235 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 1322.631667, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 782.6868330000001, + "phases": { + "detectGroupings": 46.619495000003326, + "sharedAnalysis": 51.22424299999943, + "referenceCompile": 194.01742000000013, + "virtualCompile": 452.3914159999979, + "sharedCompile": 32.14187899999911 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 305552, + "before": { + "rss": 194019328, + "heapTotal": 78217216, + "heapUsed": 8986120, + "external": 6583271, + "arrayBuffers": 1482837 + }, + "after": { + "rss": 312836096, + "heapTotal": 176783360, + "heapUsed": 53265928, + "external": 16133501, + "arrayBuffers": 13842761 + }, + "retained": { + "rss": 312836096, + "heapTotal": 152141824, + "heapUsed": 8525304, + "external": 16133501, + "arrayBuffers": 12861241 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 769.1987919999997, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 473.973375, + "phases": { + "parseAnalyze": 52.25444000000073, + "detectGroupings": 0.37536600000066755, + "sharedAnalysis": 9.111413000001448, + "referenceCompile": 133.29500900000096, + "virtualCompile": 259.33888899999977, + "sharedCompile": 14.811043000000268 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 188992, + "before": { + "rss": 115621888, + "heapTotal": 47022080, + "heapUsed": 8452504, + "external": 3888684, + "arrayBuffers": 345387 + }, + "after": { + "rss": 193363968, + "heapTotal": 87654400, + "heapUsed": 36242792, + "external": 8819239, + "arrayBuffers": 6528499 + }, + "retained": { + "rss": 192905216, + "heapTotal": 78479360, + "heapUsed": 8495392, + "external": 8819239, + "arrayBuffers": 5921670 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 823.2411250000005, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 502.33391699999993, + "phases": { + "parseAnalyze": 60.93491799999981, + "detectGroupings": 0.4584929999994074, + "sharedAnalysis": 8.891794000000687, + "referenceCompile": 143.39820500000008, + "virtualCompile": 267.0149710000011, + "sharedCompile": 16.099834000000214 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 190960, + "before": { + "rss": 115097600, + "heapTotal": 47546368, + "heapUsed": 8374376, + "external": 4072742, + "arrayBuffers": 1782042 + }, + "after": { + "rss": 195493888, + "heapTotal": 92110848, + "heapUsed": 53369816, + "external": 13668924, + "arrayBuffers": 11378184 + }, + "retained": { + "rss": 195493888, + "heapTotal": 88440832, + "heapUsed": 8484840, + "external": 13668924, + "arrayBuffers": 11182272 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 1085.886458, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 692.079833, + "phases": { + "detectGroupings": 51.81999100000121, + "sharedAnalysis": 49.583828000001176, + "referenceCompile": 185.90791299999978, + "virtualCompile": 375.49691799999755, + "sharedCompile": 24.14774400000033 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 301008, + "before": { + "rss": 208502784, + "heapTotal": 80576512, + "heapUsed": 8507896, + "external": 6905403, + "arrayBuffers": 1983739 + }, + "after": { + "rss": 308068352, + "heapTotal": 178618368, + "heapUsed": 68301160, + "external": 18310003, + "arrayBuffers": 16019263 + }, + "retained": { + "rss": 308084736, + "heapTotal": 160268288, + "heapUsed": 8604968, + "external": 18310003, + "arrayBuffers": 15571007 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-route-analysis.json b/benchmarks/compiler/results/quiet-initial-route-analysis.json new file mode 100644 index 00000000000..8f7afcbd101 --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-route-analysis.json @@ -0,0 +1,277 @@ +{ + "timestamp": "2026-09-26T13:32:23.295Z", + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1354.2221670000001, + "medianPeakRssMiB": 645.8125, + "medianWallMs": 1946.062958 + }, + "samples": [ + { + "buildMs": 1354.2221670000001, + "peakRssMiB": 645.8125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "analyzerCalls": 751, + "analysesByFile": { + "routes/__root.tsx": 1, + "routes/route-0002.tsx": 3, + "routes/route-0003.tsx": 3, + "routes/route-0001.tsx": 3, + "routes/route-0000.tsx": 3, + "routes/route-0021.tsx": 3, + "routes/route-0017.tsx": 3, + "routes/route-0016.tsx": 3, + "routes/route-0014.tsx": 3, + "routes/route-0015.tsx": 3, + "routes/route-0019.tsx": 3, + "routes/route-0013.tsx": 3, + "routes/route-0020.tsx": 3, + "routes/route-0018.tsx": 3, + "routes/route-0039.tsx": 3, + "routes/route-0031.tsx": 3, + "routes/route-0032.tsx": 3, + "routes/route-0030.tsx": 3, + "routes/route-0033.tsx": 3, + "routes/route-0023.tsx": 3, + "routes/route-0022.tsx": 3, + "routes/route-0024.tsx": 3, + "routes/route-0025.tsx": 3, + "routes/route-0034.tsx": 3, + "routes/route-0035.tsx": 3, + "routes/route-0036.tsx": 3, + "routes/route-0059.tsx": 3, + "routes/route-0026.tsx": 3, + "routes/route-0027.tsx": 3, + "routes/route-0037.tsx": 3, + "routes/route-0040.tsx": 3, + "routes/route-0038.tsx": 3, + "routes/route-0029.tsx": 3, + "routes/route-0041.tsx": 3, + "routes/route-0042.tsx": 3, + "routes/route-0028.tsx": 3, + "routes/route-0050.tsx": 3, + "routes/route-0051.tsx": 3, + "routes/route-0044.tsx": 3, + "routes/route-0053.tsx": 3, + "routes/route-0052.tsx": 3, + "routes/route-0045.tsx": 3, + "routes/route-0054.tsx": 3, + "routes/route-0055.tsx": 3, + "routes/route-0047.tsx": 3, + "routes/route-0046.tsx": 3, + "routes/route-0048.tsx": 3, + "routes/route-0056.tsx": 3, + "routes/route-0057.tsx": 3, + "routes/route-0049.tsx": 3, + "routes/route-0104.tsx": 3, + "routes/route-0043.tsx": 3, + "routes/route-0105.tsx": 3, + "routes/route-0060.tsx": 3, + "routes/route-0126.tsx": 3, + "routes/route-0061.tsx": 3, + "routes/route-0058.tsx": 3, + "routes/route-0062.tsx": 3, + "routes/route-0107.tsx": 3, + "routes/route-0063.tsx": 3, + "routes/route-0106.tsx": 3, + "routes/route-0108.tsx": 3, + "routes/route-0109.tsx": 3, + "routes/route-0064.tsx": 3, + "routes/route-0084.tsx": 3, + "routes/route-0085.tsx": 3, + "routes/route-0012.tsx": 3, + "routes/route-0110.tsx": 3, + "routes/route-0111.tsx": 3, + "routes/route-0065.tsx": 3, + "routes/route-0005.tsx": 3, + "routes/route-0004.tsx": 3, + "routes/route-0112.tsx": 3, + "routes/route-0095.tsx": 3, + "routes/route-0006.tsx": 3, + "routes/route-0087.tsx": 3, + "routes/route-0066.tsx": 3, + "routes/route-0113.tsx": 3, + "routes/route-0088.tsx": 3, + "routes/route-0008.tsx": 3, + "routes/route-0114.tsx": 3, + "routes/route-0007.tsx": 3, + "routes/route-0009.tsx": 3, + "routes/route-0010.tsx": 3, + "routes/route-0115.tsx": 3, + "routes/route-0089.tsx": 3, + "routes/route-0011.tsx": 3, + "routes/route-0090.tsx": 3, + "routes/route-0091.tsx": 3, + "routes/route-0092.tsx": 3, + "routes/route-0093.tsx": 3, + "routes/route-0249.tsx": 3, + "routes/route-0099.tsx": 3, + "routes/route-0075.tsx": 3, + "routes/route-0094.tsx": 3, + "routes/route-0127.tsx": 3, + "routes/route-0096.tsx": 3, + "routes/route-0128.tsx": 3, + "routes/route-0068.tsx": 3, + "routes/route-0097.tsx": 3, + "routes/route-0129.tsx": 3, + "routes/route-0069.tsx": 3, + "routes/route-0130.tsx": 3, + "routes/route-0131.tsx": 3, + "routes/route-0098.tsx": 3, + "routes/route-0072.tsx": 3, + "routes/route-0070.tsx": 3, + "routes/route-0073.tsx": 3, + "routes/route-0071.tsx": 3, + "routes/route-0074.tsx": 3, + "routes/route-0132.tsx": 3, + "routes/route-0133.tsx": 3, + "routes/route-0134.tsx": 3, + "routes/route-0135.tsx": 3, + "routes/route-0136.tsx": 3, + "routes/route-0079.tsx": 3, + "routes/route-0077.tsx": 3, + "routes/route-0137.tsx": 3, + "routes/route-0076.tsx": 3, + "routes/route-0078.tsx": 3, + "routes/route-0139.tsx": 3, + "routes/route-0102.tsx": 3, + "routes/route-0101.tsx": 3, + "routes/route-0100.tsx": 3, + "routes/route-0140.tsx": 3, + "routes/route-0141.tsx": 3, + "routes/route-0138.tsx": 3, + "routes/route-0121.tsx": 3, + "routes/route-0142.tsx": 3, + "routes/route-0103.tsx": 3, + "routes/route-0143.tsx": 3, + "routes/route-0117.tsx": 3, + "routes/route-0081.tsx": 3, + "routes/route-0144.tsx": 3, + "routes/route-0118.tsx": 3, + "routes/route-0086.tsx": 3, + "routes/route-0145.tsx": 3, + "routes/route-0146.tsx": 3, + "routes/route-0080.tsx": 3, + "routes/route-0147.tsx": 3, + "routes/route-0148.tsx": 3, + "routes/route-0123.tsx": 3, + "routes/route-0119.tsx": 3, + "routes/route-0124.tsx": 3, + "routes/route-0149.tsx": 3, + "routes/route-0122.tsx": 3, + "routes/route-0120.tsx": 3, + "routes/route-0125.tsx": 3, + "routes/route-0150.tsx": 3, + "routes/route-0083.tsx": 3, + "routes/route-0082.tsx": 3, + "routes/route-0067.tsx": 3, + "routes/route-0200.tsx": 3, + "routes/route-0225.tsx": 3, + "routes/route-0199.tsx": 3, + "routes/route-0237.tsx": 3, + "routes/route-0238.tsx": 3, + "routes/route-0151.tsx": 3, + "routes/route-0212.tsx": 3, + "routes/route-0226.tsx": 3, + "routes/route-0239.tsx": 3, + "routes/route-0152.tsx": 3, + "routes/route-0227.tsx": 3, + "routes/route-0201.tsx": 3, + "routes/route-0154.tsx": 3, + "routes/route-0153.tsx": 3, + "routes/route-0228.tsx": 3, + "routes/route-0202.tsx": 3, + "routes/route-0229.tsx": 3, + "routes/route-0116.tsx": 3, + "routes/route-0155.tsx": 3, + "routes/route-0203.tsx": 3, + "routes/route-0156.tsx": 3, + "routes/route-0231.tsx": 3, + "routes/route-0230.tsx": 3, + "routes/route-0218.tsx": 3, + "routes/route-0213.tsx": 3, + "routes/route-0157.tsx": 3, + "routes/route-0235.tsx": 3, + "routes/route-0204.tsx": 3, + "routes/route-0234.tsx": 3, + "routes/route-0158.tsx": 3, + "routes/route-0214.tsx": 3, + "routes/route-0236.tsx": 3, + "routes/route-0205.tsx": 3, + "routes/route-0233.tsx": 3, + "routes/route-0159.tsx": 3, + "routes/route-0208.tsx": 3, + "routes/route-0232.tsx": 3, + "routes/route-0206.tsx": 3, + "routes/route-0160.tsx": 3, + "routes/route-0210.tsx": 3, + "routes/route-0209.tsx": 3, + "routes/route-0207.tsx": 3, + "routes/route-0211.tsx": 3, + "routes/route-0244.tsx": 3, + "routes/route-0161.tsx": 3, + "routes/route-0245.tsx": 3, + "routes/route-0246.tsx": 3, + "routes/route-0162.tsx": 3, + "routes/route-0241.tsx": 3, + "routes/route-0242.tsx": 3, + "routes/route-0163.tsx": 3, + "routes/route-0181.tsx": 3, + "routes/route-0243.tsx": 3, + "routes/route-0164.tsx": 3, + "routes/route-0247.tsx": 3, + "routes/route-0182.tsx": 3, + "routes/route-0248.tsx": 3, + "routes/route-0190.tsx": 3, + "routes/route-0195.tsx": 3, + "routes/route-0165.tsx": 3, + "routes/route-0183.tsx": 3, + "routes/route-0173.tsx": 3, + "routes/route-0174.tsx": 3, + "routes/route-0175.tsx": 3, + "routes/route-0196.tsx": 3, + "routes/route-0166.tsx": 3, + "routes/route-0224.tsx": 3, + "routes/route-0176.tsx": 3, + "routes/route-0219.tsx": 3, + "routes/route-0177.tsx": 3, + "routes/route-0197.tsx": 3, + "routes/route-0167.tsx": 3, + "routes/route-0178.tsx": 3, + "routes/route-0198.tsx": 3, + "routes/route-0221.tsx": 3, + "routes/route-0220.tsx": 3, + "routes/route-0194.tsx": 3, + "routes/route-0179.tsx": 3, + "routes/route-0187.tsx": 3, + "routes/route-0180.tsx": 3, + "routes/route-0168.tsx": 3, + "routes/route-0192.tsx": 3, + "routes/route-0185.tsx": 3, + "routes/route-0169.tsx": 3, + "routes/route-0193.tsx": 3, + "routes/route-0171.tsx": 3, + "routes/route-0186.tsx": 3, + "routes/route-0188.tsx": 3, + "routes/route-0172.tsx": 3, + "routes/route-0216.tsx": 3, + "routes/route-0189.tsx": 3, + "routes/route-0217.tsx": 3, + "routes/route-0215.tsx": 3, + "routes/route-0240.tsx": 3, + "routes/route-0223.tsx": 3, + "routes/route-0191.tsx": 3, + "routes/route-0184.tsx": 3, + "routes/route-0222.tsx": 3, + "routes/route-0170.tsx": 3 + }, + "wallMs": 1946.062958 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-routes-babel.json b/benchmarks/compiler/results/quiet-initial-routes-babel.json new file mode 100644 index 00000000000..02936d0fb03 --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-routes-babel.json @@ -0,0 +1,39 @@ +{ + "timestamp": "2026-09-26T13:30:10.274Z", + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 3, + "summary": { + "medianBuildMs": 1800.764417, + "medianPeakRssMiB": 729.3125, + "medianWallMs": 2123.8952090000002 + }, + "samples": [ + { + "buildMs": 1842.582958, + "peakRssMiB": 729.65625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 2509.189583 + }, + { + "buildMs": 1789.710667, + "peakRssMiB": 723.484375, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 2112.031042 + }, + { + "buildMs": 1800.764417, + "peakRssMiB": 729.3125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 2123.8952090000002 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-routes-yuku.json b/benchmarks/compiler/results/quiet-initial-routes-yuku.json new file mode 100644 index 00000000000..1bea7c321c6 --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-routes-yuku.json @@ -0,0 +1,39 @@ +{ + "timestamp": "2026-09-26T13:30:14.210Z", + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 3, + "summary": { + "medianBuildMs": 1048.704917, + "medianPeakRssMiB": 631.6875, + "medianWallMs": 1297.192833 + }, + "samples": [ + { + "buildMs": 1045.154792, + "peakRssMiB": 634.34375, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 1293.899584 + }, + { + "buildMs": 1054.557292, + "peakRssMiB": 631.6875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 1316.368333 + }, + { + "buildMs": 1048.704917, + "peakRssMiB": 629.5625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "wallMs": 1297.192833 + } + ] +} diff --git a/benchmarks/compiler/results/quiet-initial-yuku.json b/benchmarks/compiler/results/quiet-initial-yuku.json new file mode 100644 index 00000000000..c0b09d2e220 --- /dev/null +++ b/benchmarks/compiler/results/quiet-initial-yuku.json @@ -0,0 +1,345 @@ +{ + "timestamp": "2026-09-26T13:30:03.501Z", + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 3, + "iterations": 5, + "warmups": 2, + "summary": { + "yuku-roundtrip": { + "medianMsPerCorpus": 5.560275, + "minMsPerCorpus": 5.3084918000000005, + "maxMsPerCorpus": 5.602675, + "medianPeakRssMiB": 87.921875, + "medianRetainedHeapMiB": 6.127830505371094, + "medianWallMs": 97.35024999999996, + "phasesMsPerCorpus": { + "parseAnalyzeAndDecode": 2.6559584000000114, + "semanticQueries": 0.16950780000001658, + "generate": 2.586176599999999 + }, + "countsPerCorpus": { + "parses": 52, + "outputs": 52 + } + }, + "yuku-splitter": { + "medianMsPerCorpus": 92.04892500000001, + "minMsPerCorpus": 90.2012168, + "maxMsPerCorpus": 92.9427168, + "medianPeakRssMiB": 183.296875, + "medianRetainedHeapMiB": 8.071090698242188, + "medianWallMs": 734.7157919999999, + "phasesMsPerCorpus": { + "parseAnalyze": 10.428676999999789, + "detectGroupings": 0.20797400000010385, + "sharedAnalysis": 1.59809039999991, + "referenceCompile": 26.029196200000047, + "virtualCompile": 50.06271560000041, + "sharedCompile": 2.8174743999999463 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 99.515875, + "mode": "yuku-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 28.013374999999996, + "phases": { + "parseAnalyzeAndDecode": 13.303575999999921, + "semanticQueries": 0.8796720000000278, + "generate": 13.072545000000005 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 89968, + "before": { + "rss": 79986688, + "heapTotal": 16875520, + "heapUsed": 6190696, + "external": 3760608, + "arrayBuffers": 24819 + }, + "after": { + "rss": 91881472, + "heapTotal": 26836992, + "heapUsed": 12426096, + "external": 4582549, + "arrayBuffers": 2345596 + }, + "retained": { + "rss": 91930624, + "heapTotal": 25788416, + "heapUsed": 6425496, + "external": 4582549, + "arrayBuffers": 57935 + }, + "outputBytes": 220283, + "outputMapBytes": 481012, + "resolvedReferences": 21686 + }, + { + "repetition": 0, + "wallMs": 737.8357080000001, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 464.71358399999997, + "phases": { + "parseAnalyze": 52.14338499999894, + "detectGroupings": 1.0398700000005192, + "sharedAnalysis": 7.99045199999955, + "referenceCompile": 133.52687299999855, + "virtualCompile": 250.96864900000162, + "sharedCompile": 14.334958999999117 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 187632, + "before": { + "rss": 105873408, + "heapTotal": 47022080, + "heapUsed": 8366168, + "external": 5286749, + "arrayBuffers": 425919 + }, + "after": { + "rss": 191971328, + "heapTotal": 87130112, + "heapUsed": 22330208, + "external": 4833184, + "arrayBuffers": 2542444 + }, + "retained": { + "rss": 191987712, + "heapTotal": 78217216, + "heapUsed": 8463608, + "external": 4833184, + "arrayBuffers": 511760 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 734.7157919999999, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 460.24462500000004, + "phases": { + "parseAnalyze": 52.22785099999851, + "detectGroupings": 0.3365440000011404, + "sharedAnalysis": 7.906341999999654, + "referenceCompile": 130.14598100000023, + "virtualCompile": 250.31357800000205, + "sharedCompile": 14.087371999999732 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 187952, + "before": { + "rss": 105988096, + "heapTotal": 47284224, + "heapUsed": 8364376, + "external": 5285717, + "arrayBuffers": 422183 + }, + "after": { + "rss": 192299008, + "heapTotal": 87654400, + "heapUsed": 21970080, + "external": 4668455, + "arrayBuffers": 2377715 + }, + "retained": { + "rss": 191823872, + "heapTotal": 77692928, + "heapUsed": 8463080, + "external": 4668455, + "arrayBuffers": 694234 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 97.35024999999996, + "mode": "yuku-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 27.801375, + "phases": { + "parseAnalyzeAndDecode": 13.279792000000057, + "semanticQueries": 0.8471629999999237, + "generate": 12.930882999999994 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 90032, + "before": { + "rss": 80003072, + "heapTotal": 16875520, + "heapUsed": 6190312, + "external": 3760608, + "arrayBuffers": 24819 + }, + "after": { + "rss": 91963392, + "heapTotal": 27361280, + "heapUsed": 12452992, + "external": 4582549, + "arrayBuffers": 2345596 + }, + "retained": { + "rss": 91996160, + "heapTotal": 25526272, + "heapUsed": 6425496, + "external": 4582549, + "arrayBuffers": 57935 + }, + "outputBytes": 220283, + "outputMapBytes": 481012, + "resolvedReferences": 21686 + }, + { + "repetition": 2, + "wallMs": 96.08562499999994, + "mode": "yuku-roundtrip", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 26.542459, + "phases": { + "parseAnalyzeAndDecode": 12.723587999999992, + "semanticQueries": 0.8475390000000829, + "generate": 12.212578999999906 + }, + "counts": { + "parses": 52, + "outputs": 52 + }, + "peakRssKiB": 90352, + "before": { + "rss": 79872000, + "heapTotal": 16875520, + "heapUsed": 6265744, + "external": 3760608, + "arrayBuffers": 53491 + }, + "after": { + "rss": 92356608, + "heapTotal": 27361280, + "heapUsed": 12375320, + "external": 4482571, + "arrayBuffers": 2245618 + }, + "retained": { + "rss": 92241920, + "heapTotal": 26050560, + "heapUsed": 6401944, + "external": 4482571, + "arrayBuffers": 371259 + }, + "outputBytes": 220283, + "outputMapBytes": 481012, + "resolvedReferences": 21686 + }, + { + "repetition": 2, + "wallMs": 722.337333, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 451.006084, + "phases": { + "parseAnalyze": 50.706426000000306, + "detectGroupings": 1.2969080000027589, + "sharedAnalysis": 8.397678000000724, + "referenceCompile": 129.11691599999972, + "virtualCompile": 243.07574699999805, + "sharedCompile": 13.904574000000025 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 187696, + "before": { + "rss": 105873408, + "heapTotal": 46235648, + "heapUsed": 8364368, + "external": 5349149, + "arrayBuffers": 421967 + }, + "after": { + "rss": 192036864, + "heapTotal": 86605824, + "heapUsed": 22046304, + "external": 4698251, + "arrayBuffers": 2407511 + }, + "retained": { + "rss": 191561728, + "heapTotal": 77430784, + "heapUsed": 8463152, + "external": 4698251, + "arrayBuffers": 613125 + }, + "outputBytes": 937832, + "outputMapBytes": 3486427, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-bindings-1000-yuku-after.json b/benchmarks/compiler/results/scaling-bindings-1000-yuku-after.json new file mode 100644 index 00000000000..a3936875dd1 --- /dev/null +++ b/benchmarks/compiler/results/scaling-bindings-1000-yuku-after.json @@ -0,0 +1,202 @@ +{ + "timestamp": "2026-09-26T14:08:09.076Z", + "compilerFingerprint": { + "commit": "bb4423e09872aee4f2544600d0eba3303fc7db56", + "sha256": "f71d14cb7a8d356b40d5cb7ba299d89d46d505e9b4f39d2eea1e3f1672e378b2", + "javascriptFiles": 125, + "sourceSha256": "0f04578da4c0fbe2bab114763c892e0306c49c4682ea9c0ada4db3b99536befa", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 3, + "iterations": 3, + "warmups": 1, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 184.56016666666665, + "minMsPerCorpus": 182.92797233333332, + "maxMsPerCorpus": 184.8853333333333, + "medianPeakRssMiB": 202.765625, + "medianRetainedHeapMiB": 7.5687713623046875, + "medianWallMs": 834.485459, + "phasesMsPerCorpus": { + "parseAnalyze": 14.323235666666733, + "detectGroupings": 0.014291333333289913, + "sharedAnalysis": 3.663486333333329, + "referenceCompile": 38.54962433333336, + "virtualCompile": 84.63169399999997, + "sharedCompile": 42.97216699999998 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 845.774084, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 554.656, + "phases": { + "parseAnalyze": 42.9697070000002, + "detectGroupings": 0.04287399999986974, + "sharedAnalysis": 10.990458999999987, + "referenceCompile": 115.6488730000001, + "virtualCompile": 254.57246000000032, + "sharedCompile": 129.4125419999998 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 207632, + "before": { + "rss": 122060800, + "heapTotal": 49905664, + "heapUsed": 7667184, + "external": 6512155, + "arrayBuffers": 24819 + }, + "after": { + "rss": 212107264, + "heapTotal": 161923072, + "heapUsed": 55867808, + "external": 8066038, + "arrayBuffers": 5775298 + }, + "retained": { + "rss": 207192064, + "heapTotal": 150454272, + "heapUsed": 7936432, + "external": 8066038, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 832.234875, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 548.783917, + "phases": { + "parseAnalyze": 50.92733399999997, + "detectGroupings": 0.04562499999985903, + "sharedAnalysis": 8.906207999999765, + "referenceCompile": 114.2596259999998, + "virtualCompile": 245.35516399999983, + "sharedCompile": 128.29033200000015 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 243984, + "before": { + "rss": 125632512, + "heapTotal": 83722240, + "heapUsed": 7668808, + "external": 6514927, + "arrayBuffers": 4224227 + }, + "after": { + "rss": 246349824, + "heapTotal": 167460864, + "heapUsed": 39785272, + "external": 8294435, + "arrayBuffers": 6003695 + }, + "retained": { + "rss": 241287168, + "heapTotal": 156073984, + "heapUsed": 7879584, + "external": 8294435, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 834.485459, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 553.6804999999999, + "phases": { + "parseAnalyze": 42.65991800000006, + "detectGroupings": 0.04099999999993997, + "sharedAnalysis": 11.266624000000093, + "referenceCompile": 115.98516800000004, + "virtualCompile": 253.8950819999999, + "sharedCompile": 128.91650099999993 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 203296, + "before": { + "rss": 120127488, + "heapTotal": 49905664, + "heapUsed": 7670224, + "external": 6512155, + "arrayBuffers": 24819 + }, + "after": { + "rss": 207388672, + "heapTotal": 162955264, + "heapUsed": 56371368, + "external": 8066038, + "arrayBuffers": 5775298 + }, + "retained": { + "rss": 201932800, + "heapTotal": 152027136, + "heapUsed": 7937424, + "external": 8066038, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-bindings-1000-yuku-before.json b/benchmarks/compiler/results/scaling-bindings-1000-yuku-before.json new file mode 100644 index 00000000000..67cc66d2ba4 --- /dev/null +++ b/benchmarks/compiler/results/scaling-bindings-1000-yuku-before.json @@ -0,0 +1,193 @@ +{ + "timestamp": "2026-09-26T14:04:47.881Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 3, + "iterations": 3, + "warmups": 1, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 410.2259443333334, + "minMsPerCorpus": 404.9084723333333, + "maxMsPerCorpus": 411.12025, + "medianPeakRssMiB": 284.78125, + "medianRetainedHeapMiB": 7.530937194824219, + "medianWallMs": 1748.429791, + "phasesMsPerCorpus": { + "parseAnalyze": 14.413805999999871, + "detectGroupings": 0.01730566666681928, + "sharedAnalysis": 2.8135833333332507, + "referenceCompile": 92.33877700000001, + "virtualCompile": 215.45440333333363, + "sharedCompile": 83.20887533333332 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1753.1675, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 1233.36075, + "phases": { + "parseAnalyze": 43.24141799999961, + "detectGroupings": 0.05745699999988574, + "sharedAnalysis": 8.440749999999753, + "referenceCompile": 277.01633100000004, + "virtualCompile": 652.0409170000003, + "sharedCompile": 251.39579200000003 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 289920, + "before": { + "rss": 275791872, + "heapTotal": 158433280, + "heapUsed": 7659784, + "external": 6126623, + "arrayBuffers": 24819 + }, + "after": { + "rss": 289259520, + "heapTotal": 188923904, + "heapUsed": 90347736, + "external": 4487843, + "arrayBuffers": 2197103 + }, + "retained": { + "rss": 283164672, + "heapTotal": 170491904, + "heapUsed": 7896760, + "external": 4487843, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 1733.8377500000001, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 1214.7254169999999, + "phases": { + "parseAnalyze": 43.00975000000017, + "detectGroupings": 0.04837400000019443, + "sharedAnalysis": 8.454666000000316, + "referenceCompile": 274.262291, + "virtualCompile": 638.2025799999999, + "sharedCompile": 249.626626 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 291616, + "before": { + "rss": 275644416, + "heapTotal": 157122560, + "heapUsed": 7659904, + "external": 6126623, + "arrayBuffers": 24819 + }, + "after": { + "rss": 289554432, + "heapTotal": 188661760, + "heapUsed": 88388824, + "external": 4487843, + "arrayBuffers": 2197103 + }, + "retained": { + "rss": 283738112, + "heapTotal": 167084032, + "heapUsed": 7897440, + "external": 4487843, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 1748.429791, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 1230.6778330000002, + "phases": { + "parseAnalyze": 46.40254099999993, + "detectGroupings": 0.05191700000045785, + "sharedAnalysis": 8.42433200000005, + "referenceCompile": 278.93683399999964, + "virtualCompile": 646.3632100000009, + "sharedCompile": 249.3703750000002 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 296032, + "before": { + "rss": 275808256, + "heapTotal": 156336128, + "heapUsed": 7659760, + "external": 6126623, + "arrayBuffers": 24819 + }, + "after": { + "rss": 291422208, + "heapTotal": 180420608, + "heapUsed": 82381344, + "external": 4487843, + "arrayBuffers": 2197103 + }, + "retained": { + "rss": 286900224, + "heapTotal": 167346176, + "heapUsed": 7894744, + "external": 4487843, + "arrayBuffers": 24819 + }, + "outputBytes": 779708, + "outputMapBytes": 2260964, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-client-babel.json b/benchmarks/compiler/results/scaling-hydrate-client-babel.json new file mode 100644 index 00000000000..81c012aa4ac --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-client-babel.json @@ -0,0 +1,164 @@ +{ + "timestamp": "2026-09-26T14:04:07.252Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 22.066125, + "medianPeakRssMiB": 130.203125 + }, + { + "boundaries": 500, + "medianCompileMs": 78.267361, + "medianPeakRssMiB": 277.859375 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 22.066125, + "peakRssMiB": 131.171875, + "before": { + "rss": 121651200, + "heapTotal": 52789248, + "heapUsed": 15910936, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 137281536, + "heapTotal": 89505792, + "heapUsed": 16717688, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 227056 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 78.13856966666667, + "peakRssMiB": 278.640625, + "before": { + "rss": 192135168, + "heapTotal": 96059392, + "heapUsed": 16773752, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 291110912, + "heapTotal": 173654016, + "heapUsed": 18049648, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 21.921041666666667, + "peakRssMiB": 126.5, + "before": { + "rss": 116146176, + "heapTotal": 52002816, + "heapUsed": 15911288, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 132513792, + "heapTotal": 90030080, + "heapUsed": 16718448, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 227056 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 83.11226366666666, + "peakRssMiB": 266.875, + "before": { + "rss": 179978240, + "heapTotal": 95272960, + "heapUsed": 16777504, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 278872064, + "heapTotal": 173391872, + "heapUsed": 18052456, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 29.170625, + "peakRssMiB": 130.203125, + "before": { + "rss": 119488512, + "heapTotal": 52527104, + "heapUsed": 15909208, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 136101888, + "heapTotal": 89505792, + "heapUsed": 16737568, + "external": 2350686, + "arrayBuffers": 41331 + }, + "outputBytes": 227056 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 78.267361, + "peakRssMiB": 277.859375, + "before": { + "rss": 193380352, + "heapTotal": 94748672, + "heapUsed": 16861008, + "external": 2331774, + "arrayBuffers": 62733 + }, + "retained": { + "rss": 290406400, + "heapTotal": 170770432, + "heapUsed": 18024536, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-client-yuku-after.json b/benchmarks/compiler/results/scaling-hydrate-client-yuku-after.json new file mode 100644 index 00000000000..b53f181516c --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-client-yuku-after.json @@ -0,0 +1,173 @@ +{ + "timestamp": "2026-09-26T14:08:05.475Z", + "compilerFingerprint": { + "commit": "bb4423e09872aee4f2544600d0eba3303fc7db56", + "sha256": "f71d14cb7a8d356b40d5cb7ba299d89d46d505e9b4f39d2eea1e3f1672e378b2", + "javascriptFiles": 125, + "sourceSha256": "0f04578da4c0fbe2bab114763c892e0306c49c4682ea9c0ada4db3b99536befa", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 12.781638999999998, + "medianPeakRssMiB": 89.25 + }, + { + "boundaries": 500, + "medianCompileMs": 52.54776400000001, + "medianPeakRssMiB": 153.765625 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 12.781638999999998, + "peakRssMiB": 89.25, + "before": { + "rss": 77152256, + "heapTotal": 17661952, + "heapUsed": 7288040, + "external": 3455093, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 92569600, + "heapTotal": 28672000, + "heapUsed": 7522200, + "external": 4870423, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 51.30159700000001, + "peakRssMiB": 153.046875, + "before": { + "rss": 101548032, + "heapTotal": 46759936, + "heapUsed": 7594496, + "external": 7891781, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 155435008, + "heapTotal": 78217216, + "heapUsed": 7750320, + "external": 10016168, + "arrayBuffers": 24819 + }, + "outputBytes": 958652 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 12.606014000000002, + "peakRssMiB": 89.203125, + "before": { + "rss": 77070336, + "heapTotal": 18448384, + "heapUsed": 7287824, + "external": 3455093, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 92504064, + "heapTotal": 29458432, + "heapUsed": 7522056, + "external": 4870671, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 52.54776400000001, + "peakRssMiB": 159.578125, + "before": { + "rss": 102809600, + "heapTotal": 46235648, + "heapUsed": 7615704, + "external": 7842755, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 161742848, + "heapTotal": 80314368, + "heapUsed": 7730000, + "external": 10016168, + "arrayBuffers": 24819 + }, + "outputBytes": 958652 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 12.837472, + "peakRssMiB": 90.390625, + "before": { + "rss": 77103104, + "heapTotal": 17661952, + "heapUsed": 7287896, + "external": 3455205, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 93765632, + "heapTotal": 45449216, + "heapUsed": 7522056, + "external": 4870547, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 56.866138666666664, + "peakRssMiB": 153.765625, + "before": { + "rss": 100417536, + "heapTotal": 47022080, + "heapUsed": 7594296, + "external": 7892221, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 155779072, + "heapTotal": 77692928, + "heapUsed": 7749880, + "external": 10016168, + "arrayBuffers": 24819 + }, + "outputBytes": 958652 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-client-yuku-before.json b/benchmarks/compiler/results/scaling-hydrate-client-yuku-before.json new file mode 100644 index 00000000000..93a54c9b07a --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-client-yuku-before.json @@ -0,0 +1,164 @@ +{ + "timestamp": "2026-09-26T14:04:10.149Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 21.80027766666667, + "medianPeakRssMiB": 92.640625 + }, + { + "boundaries": 500, + "medianCompileMs": 176.65336100000002, + "medianPeakRssMiB": 198.484375 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 37.41120833333333, + "peakRssMiB": 93.609375, + "before": { + "rss": 80347136, + "heapTotal": 18710528, + "heapUsed": 7288352, + "external": 3450369, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 96845824, + "heapTotal": 44138496, + "heapUsed": 7717528, + "external": 4509795, + "arrayBuffers": 2219055 + }, + "outputBytes": 190652 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 176.65336100000002, + "peakRssMiB": 215.546875, + "before": { + "rss": 123748352, + "heapTotal": 49119232, + "heapUsed": 7596736, + "external": 7872888, + "arrayBuffers": 5622462 + }, + "retained": { + "rss": 221249536, + "heapTotal": 146096128, + "heapUsed": 8464240, + "external": 11206480, + "arrayBuffers": 1835283 + }, + "outputBytes": 958652 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 21.80027766666667, + "peakRssMiB": 92.640625, + "before": { + "rss": 80183296, + "heapTotal": 18972672, + "heapUsed": 7288512, + "external": 3450369, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 95813632, + "heapTotal": 45449216, + "heapUsed": 7525432, + "external": 4874019, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 159.74075, + "peakRssMiB": 198.484375, + "before": { + "rss": 121389056, + "heapTotal": 48594944, + "heapUsed": 7592176, + "external": 7975559, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 203063296, + "heapTotal": 146112512, + "heapUsed": 7751848, + "external": 11107825, + "arrayBuffers": 24819 + }, + "outputBytes": 958652 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 18.691653000000002, + "peakRssMiB": 92.09375, + "before": { + "rss": 80117760, + "heapTotal": 18972672, + "heapUsed": 7288520, + "external": 3450493, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 95256576, + "heapTotal": 45187072, + "heapUsed": 7693832, + "external": 4873895, + "arrayBuffers": 389539 + }, + "outputBytes": 190652 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 179.87370833333333, + "peakRssMiB": 193.28125, + "before": { + "rss": 124223488, + "heapTotal": 48070656, + "heapUsed": 7591016, + "external": 7975559, + "arrayBuffers": 5622873 + }, + "retained": { + "rss": 198983680, + "heapTotal": 146374656, + "heapUsed": 7751936, + "external": 8205704, + "arrayBuffers": 5284526 + }, + "outputBytes": 958652 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-server-babel.json b/benchmarks/compiler/results/scaling-hydrate-server-babel.json new file mode 100644 index 00000000000..cf91430e4a9 --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-server-babel.json @@ -0,0 +1,164 @@ +{ + "timestamp": "2026-09-26T14:04:14.326Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 20.30991666666667, + "medianPeakRssMiB": 125.171875 + }, + { + "boundaries": 500, + "medianCompileMs": 56.08436100000001, + "medianPeakRssMiB": 204.921875 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 18.071888666666666, + "peakRssMiB": 125.609375, + "before": { + "rss": 116178944, + "heapTotal": 52789248, + "heapUsed": 15697648, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 131563520, + "heapTotal": 54509568, + "heapUsed": 16218176, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 53.51066666666666, + "peakRssMiB": 203.40625, + "before": { + "rss": 149241856, + "heapTotal": 91602944, + "heapUsed": 16352256, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 212156416, + "heapTotal": 166051840, + "heapUsed": 17468688, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 20.30991666666667, + "peakRssMiB": 121.734375, + "before": { + "rss": 111771648, + "heapTotal": 52264960, + "heapUsed": 15698944, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 127647744, + "heapTotal": 53723136, + "heapUsed": 16216464, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 58.92326400000001, + "peakRssMiB": 204.921875, + "before": { + "rss": 149569536, + "heapTotal": 92127232, + "heapUsed": 16351736, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 213745664, + "heapTotal": 166576128, + "heapUsed": 17434584, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 20.433569333333338, + "peakRssMiB": 125.171875, + "before": { + "rss": 115818496, + "heapTotal": 52264960, + "heapUsed": 15698104, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 131252224, + "heapTotal": 53985280, + "heapUsed": 16217544, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 56.08436100000001, + "peakRssMiB": 205.828125, + "before": { + "rss": 152371200, + "heapTotal": 92389376, + "heapUsed": 16353544, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 214581248, + "heapTotal": 166051840, + "heapUsed": 17453600, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-server-yuku-after.json b/benchmarks/compiler/results/scaling-hydrate-server-yuku-after.json new file mode 100644 index 00000000000..8909b69b140 --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-server-yuku-after.json @@ -0,0 +1,173 @@ +{ + "timestamp": "2026-09-26T14:08:06.514Z", + "compilerFingerprint": { + "commit": "bb4423e09872aee4f2544600d0eba3303fc7db56", + "sha256": "f71d14cb7a8d356b40d5cb7ba299d89d46d505e9b4f39d2eea1e3f1672e378b2", + "javascriptFiles": 125, + "sourceSha256": "0f04578da4c0fbe2bab114763c892e0306c49c4682ea9c0ada4db3b99536befa", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 8.440263666666667, + "medianPeakRssMiB": 79.015625 + }, + { + "boundaries": 500, + "medianCompileMs": 36.80169433333334, + "medianPeakRssMiB": 123.78125 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.155166666666666, + "peakRssMiB": 79.25, + "before": { + "rss": 74203136, + "heapTotal": 18481152, + "heapUsed": 8277560, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 81641472, + "heapTotal": 26574848, + "heapUsed": 7459144, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 36.28755566666666, + "peakRssMiB": 122.46875, + "before": { + "rss": 91930624, + "heapTotal": 29196288, + "heapUsed": 7292688, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 123305984, + "heapTotal": 42827776, + "heapUsed": 7423064, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.440263666666667, + "peakRssMiB": 78.5625, + "before": { + "rss": 73842688, + "heapTotal": 17956864, + "heapUsed": 8271648, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 80920576, + "heapTotal": 26312704, + "heapUsed": 7461936, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 38.38943066666666, + "peakRssMiB": 127.046875, + "before": { + "rss": 93421568, + "heapTotal": 28409856, + "heapUsed": 7291944, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 128647168, + "heapTotal": 79003648, + "heapUsed": 7427208, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.458347000000002, + "peakRssMiB": 79.015625, + "before": { + "rss": 74350592, + "heapTotal": 18481152, + "heapUsed": 8292496, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 81395712, + "heapTotal": 26574848, + "heapUsed": 7458520, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 36.80169433333334, + "peakRssMiB": 123.78125, + "before": { + "rss": 91963392, + "heapTotal": 28409856, + "heapUsed": 7292928, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 124600320, + "heapTotal": 43352064, + "heapUsed": 7422904, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-hydrate-server-yuku-before.json b/benchmarks/compiler/results/scaling-hydrate-server-yuku-before.json new file mode 100644 index 00000000000..3c58db01e3a --- /dev/null +++ b/benchmarks/compiler/results/scaling-hydrate-server-yuku-before.json @@ -0,0 +1,164 @@ +{ + "timestamp": "2026-09-26T14:04:12.262Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 15.012416666666667, + "medianPeakRssMiB": 83.578125 + }, + { + "boundaries": 500, + "medianCompileMs": 103.623875, + "medianPeakRssMiB": 160.328125 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 15.168458333333334, + "peakRssMiB": 83.921875, + "before": { + "rss": 77004800, + "heapTotal": 17956864, + "heapUsed": 8259704, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 86392832, + "heapTotal": 27099136, + "heapUsed": 7376856, + "external": 3643919, + "arrayBuffers": 24819 + }, + "outputBytes": 132560 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 104.79831966666666, + "peakRssMiB": 154.171875, + "before": { + "rss": 99516416, + "heapTotal": 28147712, + "heapUsed": 7296432, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 158990336, + "heapTotal": 78741504, + "heapUsed": 7418432, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 15.012416666666667, + "peakRssMiB": 82.671875, + "before": { + "rss": 75579392, + "heapTotal": 18186240, + "heapUsed": 7236904, + "external": 2847489, + "arrayBuffers": 194891 + }, + "retained": { + "rss": 85524480, + "heapTotal": 26312704, + "heapUsed": 7358656, + "external": 3618631, + "arrayBuffers": 24819 + }, + "outputBytes": 132560 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 103.623875, + "peakRssMiB": 160.328125, + "before": { + "rss": 96550912, + "heapTotal": 30244864, + "heapUsed": 7608920, + "external": 5168946, + "arrayBuffers": 2918520 + }, + "retained": { + "rss": 162316288, + "heapTotal": 83984384, + "heapUsed": 7773992, + "external": 8884852, + "arrayBuffers": 897655 + }, + "outputBytes": 663760 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 13.815347333333335, + "peakRssMiB": 83.578125, + "before": { + "rss": 75792384, + "heapTotal": 18186240, + "heapUsed": 7252824, + "external": 2847489, + "arrayBuffers": 194891 + }, + "retained": { + "rss": 86278144, + "heapTotal": 26836992, + "heapUsed": 7507528, + "external": 3618631, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 99.40730566666667, + "peakRssMiB": 163.203125, + "before": { + "rss": 100237312, + "heapTotal": 29196288, + "heapUsed": 7606952, + "external": 5168946, + "arrayBuffers": 2918520 + }, + "retained": { + "rss": 165330944, + "heapTotal": 82411520, + "heapUsed": 7776456, + "external": 8884852, + "arrayBuffers": 897655 + }, + "outputBytes": 663760 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-10-babel.json b/benchmarks/compiler/results/scaling-initial-bindings-10-babel.json new file mode 100644 index 00000000000..b6fca2b5e79 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-10-babel.json @@ -0,0 +1,93 @@ +{ + "timestamp": "2026-09-26T14:03:20.624Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 539, + "sha256": "07eacc89c312826b10fccc4e47b472ab3049da7ccf4b94e51f8f807497b784fa" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 59.466499999999996, + "minMsPerCorpus": 59.466499999999996, + "maxMsPerCorpus": 59.466499999999996, + "medianPeakRssMiB": 102.421875, + "medianRetainedHeapMiB": 14.85888671875, + "medianWallMs": 324.645584, + "phasesMsPerCorpus": { + "detectGroupings": 9.02499899999998, + "sharedAnalysis": 5.118750000000034, + "referenceCompile": 11.567916999999966, + "virtualCompile": 18.472833999999978, + "sharedCompile": 15.035333000000037 + }, + "countsPerCorpus": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 324.645584, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 539, + "sha256": "07eacc89c312826b10fccc4e47b472ab3049da7ccf4b94e51f8f807497b784fa" + }, + "elapsedMs": 59.466499999999996, + "phases": { + "detectGroupings": 9.02499899999998, + "sharedAnalysis": 5.118750000000034, + "referenceCompile": 11.567916999999966, + "virtualCompile": 18.472833999999978, + "sharedCompile": 15.035333000000037 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 104880, + "before": { + "rss": 100532224, + "heapTotal": 31555584, + "heapUsed": 13223816, + "external": 2353257, + "arrayBuffers": 24947 + }, + "after": { + "rss": 106790912, + "heapTotal": 34439168, + "heapUsed": 24005656, + "external": 2432606, + "arrayBuffers": 123251 + }, + "retained": { + "rss": 107151360, + "heapTotal": 34177024, + "heapUsed": 15580672, + "external": 2432606, + "arrayBuffers": 123251 + }, + "outputBytes": 3899, + "outputMapBytes": 12100, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-10-yuku.json b/benchmarks/compiler/results/scaling-initial-bindings-10-yuku.json new file mode 100644 index 00000000000..bdf86e0716c --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-10-yuku.json @@ -0,0 +1,95 @@ +{ + "timestamp": "2026-09-26T14:03:20.752Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 539, + "sha256": "07eacc89c312826b10fccc4e47b472ab3049da7ccf4b94e51f8f807497b784fa" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 12.192208, + "minMsPerCorpus": 12.192208, + "maxMsPerCorpus": 12.192208, + "medianPeakRssMiB": 65.609375, + "medianRetainedHeapMiB": 7.161521911621094, + "medianWallMs": 84.673709, + "phasesMsPerCorpus": { + "parseAnalyze": 3.0685829999999967, + "detectGroupings": 0.07641600000000182, + "sharedAnalysis": 0.39050100000000043, + "referenceCompile": 4.107624999999999, + "virtualCompile": 3.058166999999969, + "sharedCompile": 1.2985830000000007 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 84.673709, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 539, + "sha256": "07eacc89c312826b10fccc4e47b472ab3049da7ccf4b94e51f8f807497b784fa" + }, + "elapsedMs": 12.192208, + "phases": { + "parseAnalyze": 3.0685829999999967, + "detectGroupings": 0.07641600000000182, + "sharedAnalysis": 0.39050100000000043, + "referenceCompile": 4.107624999999999, + "virtualCompile": 3.058166999999969, + "sharedCompile": 1.2985830000000007 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 67184, + "before": { + "rss": 64651264, + "heapTotal": 12156928, + "heapUsed": 6594312, + "external": 2315867, + "arrayBuffers": 24819 + }, + "after": { + "rss": 68452352, + "heapTotal": 13205504, + "heapUsed": 8620872, + "external": 2526394, + "arrayBuffers": 235654 + }, + "retained": { + "rss": 68616192, + "heapTotal": 12681216, + "heapUsed": 7509400, + "external": 2526394, + "arrayBuffers": 33323 + }, + "outputBytes": 3767, + "outputMapBytes": 9307, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-100-babel.json b/benchmarks/compiler/results/scaling-initial-bindings-100-babel.json new file mode 100644 index 00000000000..95df6bf72c6 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-100-babel.json @@ -0,0 +1,93 @@ +{ + "timestamp": "2026-09-26T14:03:21.286Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 3779, + "sha256": "aa5dc6a57b94312699b7f6685db394a120c344e9d65a8ff29584bc6a9e9e91b8" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 139.009375, + "minMsPerCorpus": 139.009375, + "maxMsPerCorpus": 139.009375, + "medianPeakRssMiB": 144.125, + "medianRetainedHeapMiB": 15.9534912109375, + "medianWallMs": 335.36575, + "phasesMsPerCorpus": { + "detectGroupings": 15.701750000000004, + "sharedAnalysis": 36.067916999999966, + "referenceCompile": 23.784209000000033, + "virtualCompile": 34.964500000000044, + "sharedCompile": 28.15391599999998 + }, + "countsPerCorpus": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 335.36575, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 3779, + "sha256": "aa5dc6a57b94312699b7f6685db394a120c344e9d65a8ff29584bc6a9e9e91b8" + }, + "elapsedMs": 139.009375, + "phases": { + "detectGroupings": 15.701750000000004, + "sharedAnalysis": 36.067916999999966, + "referenceCompile": 23.784209000000033, + "virtualCompile": 34.964500000000044, + "sharedCompile": 28.15391599999998 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 147584, + "before": { + "rss": 120258560, + "heapTotal": 49119232, + "heapUsed": 13264440, + "external": 2345029, + "arrayBuffers": 24947 + }, + "after": { + "rss": 150700032, + "heapTotal": 95141888, + "heapUsed": 30400592, + "external": 2388616, + "arrayBuffers": 41331 + }, + "retained": { + "rss": 151126016, + "heapTotal": 91209728, + "heapUsed": 16728448, + "external": 2350686, + "arrayBuffers": 41331 + }, + "outputBytes": 20639, + "outputMapBytes": 73889, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-100-yuku.json b/benchmarks/compiler/results/scaling-initial-bindings-100-yuku.json new file mode 100644 index 00000000000..51013837449 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-100-yuku.json @@ -0,0 +1,95 @@ +{ + "timestamp": "2026-09-26T14:03:20.908Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 3779, + "sha256": "aa5dc6a57b94312699b7f6685db394a120c344e9d65a8ff29584bc6a9e9e91b8" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 38.500125000000004, + "minMsPerCorpus": 38.500125000000004, + "maxMsPerCorpus": 38.500125000000004, + "medianPeakRssMiB": 73.484375, + "medianRetainedHeapMiB": 7.127532958984375, + "medianWallMs": 110.48400000000001, + "phasesMsPerCorpus": { + "parseAnalyze": 5.971749000000003, + "detectGroupings": 0.08891599999999755, + "sharedAnalysis": 0.7712910000000193, + "referenceCompile": 10.815333999999993, + "virtualCompile": 15.059125000000009, + "sharedCompile": 5.549124000000006 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 110.48400000000001, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 3779, + "sha256": "aa5dc6a57b94312699b7f6685db394a120c344e9d65a8ff29584bc6a9e9e91b8" + }, + "elapsedMs": 38.500125000000004, + "phases": { + "parseAnalyze": 5.971749000000003, + "detectGroupings": 0.08891599999999755, + "sharedAnalysis": 0.7712910000000193, + "referenceCompile": 10.815333999999993, + "virtualCompile": 15.059125000000009, + "sharedCompile": 5.549124000000006 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 75248, + "before": { + "rss": 64733184, + "heapTotal": 12419072, + "heapUsed": 6446264, + "external": 2315867, + "arrayBuffers": 24819 + }, + "after": { + "rss": 76972032, + "heapTotal": 27885568, + "heapUsed": 13635464, + "external": 2776615, + "arrayBuffers": 485875 + }, + "retained": { + "rss": 77053952, + "heapTotal": 26836992, + "heapUsed": 7473760, + "external": 2776615, + "arrayBuffers": 24819 + }, + "outputBytes": 19427, + "outputMapBytes": 54940, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-1000-babel.json b/benchmarks/compiler/results/scaling-initial-bindings-1000-babel.json new file mode 100644 index 00000000000..4b91c6d555f --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-1000-babel.json @@ -0,0 +1,93 @@ +{ + "timestamp": "2026-09-26T14:03:25.843Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 4302.64825, + "minMsPerCorpus": 4302.64825, + "maxMsPerCorpus": 4302.64825, + "medianPeakRssMiB": 308.125, + "medianRetainedHeapMiB": 16.495086669921875, + "medianWallMs": 4497.141917, + "phasesMsPerCorpus": { + "detectGroupings": 46.618749999999636, + "sharedAnalysis": 2591.3919990000004, + "referenceCompile": 143.4795839999997, + "virtualCompile": 255.32770899999923, + "sharedCompile": 1265.0571260000002 + }, + "countsPerCorpus": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 4497.141917, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 4302.64825, + "phases": { + "detectGroupings": 46.618749999999636, + "sharedAnalysis": 2591.3919990000004, + "referenceCompile": 143.4795839999997, + "virtualCompile": 255.32770899999923, + "sharedCompile": 1265.0571260000002 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 315520, + "before": { + "rss": 108494848, + "heapTotal": 49381376, + "heapUsed": 13308528, + "external": 2311040, + "arrayBuffers": 24947 + }, + "after": { + "rss": 318750720, + "heapTotal": 236322816, + "heapUsed": 145491256, + "external": 2350686, + "arrayBuffers": 41331 + }, + "retained": { + "rss": 322551808, + "heapTotal": 185188352, + "heapUsed": 17296352, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 206939, + "outputMapBytes": 752118, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-bindings-1000-yuku.json b/benchmarks/compiler/results/scaling-initial-bindings-1000-yuku.json new file mode 100644 index 00000000000..383a1dc4dfc --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-bindings-1000-yuku.json @@ -0,0 +1,95 @@ +{ + "timestamp": "2026-09-26T14:03:26.419Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 1, + "iterations": 1, + "warmups": 0, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 466.72283300000004, + "minMsPerCorpus": 466.72283300000004, + "maxMsPerCorpus": 466.72283300000004, + "medianPeakRssMiB": 269.6875, + "medianRetainedHeapMiB": 7.3061370849609375, + "medianWallMs": 536.919458, + "phasesMsPerCorpus": { + "parseAnalyze": 21.71095900000006, + "detectGroupings": 0.07974899999999252, + "sharedAnalysis": 5.64891700000004, + "referenceCompile": 115.21904299999994, + "virtualCompile": 237.59470800000003, + "sharedCompile": 85.89354200000002 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 536.919458, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 466.72283300000004, + "phases": { + "parseAnalyze": 21.71095900000006, + "detectGroupings": 0.07974899999999252, + "sharedAnalysis": 5.64891700000004, + "referenceCompile": 115.21904299999994, + "virtualCompile": 237.59470800000003, + "sharedCompile": 85.89354200000002 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 276160, + "before": { + "rss": 65077248, + "heapTotal": 16351232, + "heapUsed": 6523120, + "external": 2275281, + "arrayBuffers": 24819 + }, + "after": { + "rss": 282689536, + "heapTotal": 212779008, + "heapUsed": 114224688, + "external": 6126663, + "arrayBuffers": 3835923 + }, + "retained": { + "rss": 276021248, + "heapTotal": 155025408, + "heapUsed": 7661040, + "external": 6126663, + "arrayBuffers": 24819 + }, + "outputBytes": 194927, + "outputMapBytes": 565241, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-hydrate-client-babel.json b/benchmarks/compiler/results/scaling-initial-hydrate-client-babel.json new file mode 100644 index 00000000000..c8f36cafab6 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-hydrate-client-babel.json @@ -0,0 +1,100 @@ +{ + "timestamp": "2026-09-26T14:02:51.649Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 1, + "iterations": 1, + "summary": [ + { + "boundaries": 10, + "medianCompileMs": 4.74237500000001, + "medianPeakRssMiB": 110.640625 + }, + { + "boundaries": 100, + "medianCompileMs": 28.234375, + "medianPeakRssMiB": 112.328125 + }, + { + "boundaries": 500, + "medianCompileMs": 108.22670800000003, + "medianPeakRssMiB": 184.328125 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 10, + "sourceBytes": 1457, + "sourceHash": "a32baf40e30e8b5b3fe5b2e3015614e035f1b4616dbc918bca0583e0e143a2f0", + "msPerCompile": 4.74237500000001, + "peakRssMiB": 110.640625, + "before": { + "rss": 115654656, + "heapTotal": 50954240, + "heapUsed": 15465160, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 116015104, + "heapTotal": 51740672, + "heapUsed": 15595784, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 12494 + }, + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 28.234375, + "peakRssMiB": 112.328125, + "before": { + "rss": 117112832, + "heapTotal": 52789248, + "heapUsed": 15909936, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 117784576, + "heapTotal": 52264960, + "heapUsed": 15947952, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 113528 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 108.22670800000003, + "peakRssMiB": 184.328125, + "before": { + "rss": 179159040, + "heapTotal": 97107968, + "heapUsed": 16785712, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 193134592, + "heapTotal": 165789696, + "heapUsed": 16676288, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 571924 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-hydrate-client-yuku.json b/benchmarks/compiler/results/scaling-initial-hydrate-client-yuku.json new file mode 100644 index 00000000000..1efed08dd45 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-hydrate-client-yuku.json @@ -0,0 +1,100 @@ +{ + "timestamp": "2026-09-26T14:02:52.336Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 1, + "iterations": 1, + "summary": [ + { + "boundaries": 10, + "medianCompileMs": 2.7570830000000015, + "medianPeakRssMiB": 65.71875 + }, + { + "boundaries": 100, + "medianCompileMs": 19.344542000000004, + "medianPeakRssMiB": 80.1875 + }, + { + "boundaries": 500, + "medianCompileMs": 187.954667, + "medianPeakRssMiB": 151.171875 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 10, + "sourceBytes": 1457, + "sourceHash": "a32baf40e30e8b5b3fe5b2e3015614e035f1b4616dbc918bca0583e0e143a2f0", + "msPerCompile": 2.7570830000000015, + "peakRssMiB": 65.71875, + "before": { + "rss": 68534272, + "heapTotal": 17137664, + "heapUsed": 7178408, + "external": 2365144, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 68911104, + "heapTotal": 17137664, + "heapUsed": 7303712, + "external": 2405422, + "arrayBuffers": 24819 + }, + "outputBytes": 10830 + }, + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 19.344542000000004, + "peakRssMiB": 80.1875, + "before": { + "rss": 79626240, + "heapTotal": 18972672, + "heapUsed": 7288424, + "external": 3450493, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 83656704, + "heapTotal": 25526272, + "heapUsed": 7400304, + "external": 3498090, + "arrayBuffers": 24819 + }, + "outputBytes": 95326 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 187.954667, + "peakRssMiB": 151.171875, + "before": { + "rss": 123453440, + "heapTotal": 47808512, + "heapUsed": 7616256, + "external": 7903916, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 155303936, + "heapTotal": 82411520, + "heapUsed": 7641016, + "external": 8161030, + "arrayBuffers": 5487968 + }, + "outputBytes": 479326 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-hydrate-server-babel.json b/benchmarks/compiler/results/scaling-initial-hydrate-server-babel.json new file mode 100644 index 00000000000..1956d30d569 --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-hydrate-server-babel.json @@ -0,0 +1,100 @@ +{ + "timestamp": "2026-09-26T14:02:53.869Z", + "compilerFingerprint": { + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 1, + "iterations": 1, + "summary": [ + { + "boundaries": 10, + "medianCompileMs": 4.505583999999999, + "medianPeakRssMiB": 112.484375 + }, + { + "boundaries": 100, + "medianCompileMs": 21.648458000000005, + "medianPeakRssMiB": 114.796875 + }, + { + "boundaries": 500, + "medianCompileMs": 81.15016700000001, + "medianPeakRssMiB": 177.390625 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 10, + "sourceBytes": 1457, + "sourceHash": "a32baf40e30e8b5b3fe5b2e3015614e035f1b4616dbc918bca0583e0e143a2f0", + "msPerCompile": 4.505583999999999, + "peakRssMiB": 112.484375, + "before": { + "rss": 117604352, + "heapTotal": 51740672, + "heapUsed": 15267784, + "external": 2331774, + "arrayBuffers": 62733 + }, + "retained": { + "rss": 117817344, + "heapTotal": 51478528, + "heapUsed": 15364256, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 9826 + }, + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 21.648458000000005, + "peakRssMiB": 114.796875, + "before": { + "rss": 115589120, + "heapTotal": 53051392, + "heapUsed": 15689000, + "external": 2331774, + "arrayBuffers": 62733 + }, + "retained": { + "rss": 120373248, + "heapTotal": 52527104, + "heapUsed": 15839376, + "external": 2350686, + "arrayBuffers": 41331 + }, + "outputBytes": 83378 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 81.15016700000001, + "peakRssMiB": 177.390625, + "before": { + "rss": 167591936, + "heapTotal": 91865088, + "heapUsed": 16392176, + "external": 2331661, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 185860096, + "heapTotal": 86622208, + "heapUsed": 16218464, + "external": 2350686, + "arrayBuffers": 41331 + }, + "outputBytes": 416978 + } + ] +} diff --git a/benchmarks/compiler/results/scaling-initial-hydrate-server-yuku.json b/benchmarks/compiler/results/scaling-initial-hydrate-server-yuku.json new file mode 100644 index 00000000000..5fa23f5bd1c --- /dev/null +++ b/benchmarks/compiler/results/scaling-initial-hydrate-server-yuku.json @@ -0,0 +1,100 @@ +{ + "timestamp": "2026-09-26T14:02:52.902Z", + "compilerFingerprint": { + "sha256": "c2b53bbd1dc22794d2520dc8696467bc14d84c759e69bffb5832c5c90f3ae2d2", + "javascriptFiles": 125 + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 1, + "iterations": 1, + "summary": [ + { + "boundaries": 10, + "medianCompileMs": 2.254125000000002, + "medianPeakRssMiB": 65.71875 + }, + { + "boundaries": 100, + "medianCompileMs": 15.11508400000001, + "medianPeakRssMiB": 75.265625 + }, + { + "boundaries": 500, + "medianCompileMs": 105.53554199999999, + "medianPeakRssMiB": 115.859375 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 10, + "sourceBytes": 1457, + "sourceHash": "a32baf40e30e8b5b3fe5b2e3015614e035f1b4616dbc918bca0583e0e143a2f0", + "msPerCompile": 2.254125000000002, + "peakRssMiB": 65.71875, + "before": { + "rss": 68534272, + "heapTotal": 16875520, + "heapUsed": 7072416, + "external": 2341918, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 68780032, + "heapTotal": 16613376, + "heapUsed": 7213000, + "external": 2382196, + "arrayBuffers": 24819 + }, + "outputBytes": 7832 + }, + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 15.11508400000001, + "peakRssMiB": 75.265625, + "before": { + "rss": 75546624, + "heapTotal": 18186240, + "heapUsed": 7253688, + "external": 2847489, + "arrayBuffers": 194891 + }, + "retained": { + "rss": 78217216, + "heapTotal": 16875520, + "heapUsed": 7269168, + "external": 3057839, + "arrayBuffers": 24819 + }, + "outputBytes": 66280 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 105.53554199999999, + "peakRssMiB": 115.859375, + "before": { + "rss": 97779712, + "heapTotal": 29720576, + "heapUsed": 7608344, + "external": 5168946, + "arrayBuffers": 897655 + }, + "retained": { + "rss": 118751232, + "heapTotal": 47546368, + "heapUsed": 7703480, + "external": 6082096, + "arrayBuffers": 897655 + }, + "outputBytes": 331880 + } + ] +} diff --git a/benchmarks/compiler/route-heavy.mjs b/benchmarks/compiler/route-heavy.mjs new file mode 100644 index 00000000000..f024c33d983 --- /dev/null +++ b/benchmarks/compiler/route-heavy.mjs @@ -0,0 +1,292 @@ +import { compilerFingerprint } from './provenance.mjs' +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { createHash } from 'node:crypto' +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' +import { cpus } from 'node:os' +import { registerHooks } from 'node:module' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +const args = process.argv.slice(2) +const option = (key, fallback) => { + const index = args.indexOf(key) + return index === -1 ? fallback : args[index + 1] +} +const workspace = path.resolve( + option('--workspace', fileURLToPath(new URL('../../', import.meta.url))), +) +const routes = Number(option('--routes', '250')) +const repetitions = Number(option('--repetitions', '5')) +const profileAnalysis = args.includes('--profile-analysis') +const cacheLimit = option('--analysis-cache-limit', null) +if (cacheLimit !== null) { + assert.ok(Number.isSafeInteger(Number(cacheLimit)) && Number(cacheLimit) > 0) +} +assert.ok(Number.isSafeInteger(routes) && routes > 0) +assert.ok(Number.isSafeInteger(repetitions) && repetitions > 0) +if (!args.includes('--worker')) { + const samples = [] + for (let repetition = 0; repetition < repetitions; repetition++) { + const started = performance.now() + const result = spawnSync( + process.execPath, + [ + '--expose-gc', + fileURLToPath(import.meta.url), + '--worker', + '--workspace', + workspace, + '--routes', + String(routes), + ...(profileAnalysis ? ['--profile-analysis'] : []), + ...(cacheLimit === null ? [] : ['--analysis-cache-limit', cacheLimit]), + ], + { + encoding: 'utf8', + maxBuffer: 16 * 1024 * 1024, + env: { ...process.env, NODE_ENV: 'production' }, + }, + ) + assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`) + const line = result.stdout + .split('\n') + .find((item) => item.startsWith('BENCHMARK_JSON=')) + assert.ok(line, result.stdout) + samples.push({ + ...JSON.parse(line.slice(15)), + wallMs: performance.now() - started, + }) + } + assert.ok( + samples.every((sample) => sample.sourceHash === samples[0].sourceHash), + ) + const median = (key) => + samples.map((sample) => sample[key]).sort((a, b) => a - b)[ + Math.floor(samples.length / 2) + ] + console.log( + JSON.stringify( + { + timestamp: new Date().toISOString(), + compilerFingerprint: compilerFingerprint(workspace), + workspace, + node: process.version, + cpu: cpus()[0].model, + routes, + repetitions, + ...(cacheLimit === null + ? {} + : { analysisCacheLimit: Number(cacheLimit) }), + summary: { + medianBuildMs: median('buildMs'), + medianPeakRssMiB: median('peakRssMiB'), + medianWallMs: median('wallMs'), + }, + samples, + }, + null, + 2, + ), + ) +} else { + const analysisCalls = [] + let instrumented = false + let cacheLimitReplaced = false + if (profileAnalysis || cacheLimit !== null) { + globalThis.__tanstackCompilerBenchmarkAnalyses = analysisCalls + const compilerUrl = pathToFileURL( + path.join( + workspace, + 'packages/router-plugin/dist/esm/core/code-splitter/compilers.js', + ), + ).href + const pluginUrl = pathToFileURL( + path.join( + workspace, + 'packages/router-plugin/dist/esm/core/router-code-splitter-plugin.js', + ), + ).href + registerHooks({ + load(url, context, nextLoad) { + const loaded = nextLoad(url, context) + const profileCompiler = profileAnalysis && url === compilerUrl + const profileCache = profileAnalysis && url === pluginUrl + const replaceCacheLimit = cacheLimit !== null && url === pluginUrl + if (!profileCompiler && !profileCache && !replaceCacheLimit) { + return loaded + } + let source = + typeof loaded.source === 'string' + ? loaded.source + : Buffer.from(loaded.source).toString() + if (replaceCacheLimit) { + const original = 'analyzedRoutes.size > 128' + assert.ok( + source.includes(original), + 'Cannot locate route analysis cache limit', + ) + cacheLimitReplaced = true + source = source.replace( + original, + `analyzedRoutes.size > ${cacheLimit}`, + ) + } + if (profileCache) { + const clear = 'analyzedRoutes.clear();' + assert.ok( + source.includes(clear), + 'Cannot locate route analysis cache cleanup', + ) + source = source.replace( + clear, + `global.gc(); +const cacheBefore = process.memoryUsage(); +const cacheEntries = analyzedRoutes.size; +${clear} +global.gc(); +globalThis.__tanstackCompilerBenchmarkCache = { entries: cacheEntries, beforeClear: cacheBefore, afterClear: process.memoryUsage() };`, + ) + } + if (!profileCompiler) { + return { ...loaded, source } + } + const signature = 'function analyzeRouteModule(options) {' + assert.ok( + source.includes(signature), + 'Cannot locate native route analyzer for benchmark instrumentation', + ) + instrumented = true + return { + ...loaded, + source: source.replace( + signature, + signature + + '\nglobalThis.__tanstackCompilerBenchmarkAnalyses.push(options.filename);', + ), + } + }, + }) + } + const { build } = await import( + pathToFileURL(path.join(workspace, 'node_modules/vite/dist/node/index.js')) + .href + ) + const { tanstackRouter } = await import( + pathToFileURL( + path.join(workspace, 'packages/router-plugin/dist/esm/vite.js'), + ).href + ) + const directory = await mkdtemp( + path.join(workspace, 'packages/router-plugin/.compiler-benchmark-'), + ) + const hash = createHash('sha256') + const source = async (file, code) => { + hash.update(file).update('\0').update(code) + await writeFile(path.join(directory, file), code) + } + try { + await mkdir(path.join(directory, 'routes')) + await source( + 'index.html', + '
', + ) + await source( + 'entry.ts', + `import { createElement } from 'react' +import { createRoot } from 'react-dom/client' +import { createRouter, RouterProvider } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +const router = createRouter({ routeTree }) +createRoot(document.getElementById('app')!).render(createElement(RouterProvider, { router }))`, + ) + await source( + 'routes/__root.tsx', + `import { createElement } from 'react' +import { createRootRoute, Outlet } from '@tanstack/react-router' +export const Route = createRootRoute({ component: () => createElement(Outlet) })`, + ) + for (let i = 0; i < routes; i++) { + const id = `route-${String(i).padStart(4, '0')}` + await source( + `routes/${id}.tsx`, + `import { createElement } from 'react' +import { createFileRoute } from '@tanstack/react-router' +const seed = makeSeed(${i}) +const { state, increment } = makeState(seed) +const labels = ${JSON.stringify(Array.from({ length: 32 }, (_, index) => `Route ${i} item ${index}`))} +export const Route = createFileRoute('/${id}')({ + beforeLoad: () => ({ state }), + loader: async () => { increment(); return state }, + component: () => createElement('section', null, labels.map((label, index) => createElement('p', { key: index }, label, ':', state.value))), + pendingComponent: () => createElement('span', null, 'Loading ${id}'), + errorComponent: ({ error }: { error: Error }) => createElement('pre', null, error.message), +}) +function makeSeed(value: number) { return { value } } +function makeState(state: { value: number }) { return { state, increment: () => state.value++ } }`, + ) + } + global.gc() + const before = process.memoryUsage() + const started = performance.now() + const output = await build({ + root: directory, + configFile: false, + logLevel: 'silent', + plugins: [ + tanstackRouter({ + target: 'react', + routesDirectory: './routes', + generatedRouteTree: './routeTree.gen.ts', + autoCodeSplitting: true, + codeSplittingOptions: { + addHmr: false, + defaultBehavior: [ + ['loader'], + ['component'], + ['pendingComponent', 'errorComponent'], + ], + }, + }), + ], + build: { outDir: 'dist', minify: true, sourcemap: true }, + }) + const buildMs = performance.now() - started + const after = process.memoryUsage() + global.gc() + const retained = process.memoryUsage() + const bundles = Array.isArray(output) ? output : [output] + let chunks = 0 + let emittedJsBytes = 0 + for (const bundle of bundles) { + for (const item of bundle.output ?? []) { + if (item.type === 'chunk') { + chunks++ + emittedJsBytes += Buffer.byteLength(item.code) + } + } + } + const analysesByFile = {} + if (profileAnalysis) { + assert.ok( + instrumented, + 'Native route analyzer instrumentation was not loaded', + ) + for (const filename of analysisCalls) { + const name = path.relative(directory, filename) + analysesByFile[name] = (analysesByFile[name] ?? 0) + 1 + } + } + if (cacheLimit !== null) { + assert.ok( + cacheLimitReplaced, + 'Route analysis cache override was not loaded', + ) + } + console.log( + `BENCHMARK_JSON=${JSON.stringify({ buildMs, peakRssMiB: process.resourceUsage().maxRSS / 1024, sourceHash: hash.digest('hex'), chunks, emittedJsBytes, before, after, retained, ...(profileAnalysis ? { analyzerCalls: analysisCalls.length, analysesByFile, liveCache: globalThis.__tanstackCompilerBenchmarkCache } : {}) })}`, + ) + } finally { + await rm(directory, { recursive: true, force: true }) + } +} diff --git a/benchmarks/compiler/yuku-feasibility/README.md b/benchmarks/compiler/yuku-feasibility/README.md new file mode 100644 index 00000000000..14cfa80d69c --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/README.md @@ -0,0 +1,95 @@ +# Yuku feasibility and upstream findings + +Investigated with Node 24.8.0 on macOS arm64, using published `yuku-parser`, +`yuku-analyzer`, and `yuku-codegen` **0.11.0**. The independent syntax oracle was +`@babel/parser` 7.28.5; it is only an investigation tool, not a proposed runtime +compatibility layer. The initial isolated probes did not change workspace dependencies. The subsequent +migration uses Yuku directly in the compiler packages; Babel is not retained as +an AST compatibility layer. + +## Confirmed upstream defect: whitespace-padded purity comments disappear + +The documented default `comments: 'some'` policy promises preservation of +annotations, but drops common forms such as `/* @__PURE__ */` and +`/* #__PURE__ */`. The annotation is present in the parsed AST. Printing removes +it. This can prevent a downstream bundler from removing a pure call. + +Install the published versions in a scratch directory, then run: + +```sh +node benchmarks/compiler/yuku-feasibility/pure-comment-repro.mjs /path/to/scratch-install +``` + +The assertion fails with 0.11.0. The generated code is +`const value = factory();`. + +Root cause is in upstream +[`src/parser/codegen/utils.zig`](https://github.com/yuku-toolchain/yuku/blob/eb400037678815bdbc2e5477c4b5458e436286ad/src/parser/codegen/utils.zig#L162), +`isSignificantBlockComment`. It recognizes `@` and `#` only as the first byte of +the comment value, and its subsequent scan recognizes legal notices but not +purity annotations. Parser comment values preserve whitespace after `/*`. +The same root cause remains in upstream commit +`eb400037678815bdbc2e5477c4b5458e436286ad` examined during this investigation. + +Proposed upstream fix: normalize leading whitespace before checking annotation +markers, or explicitly recognize whitespace-padded `@__PURE__`, `#__PURE__`, and +no-side-effects annotation forms. Add parser-to-codegen regression tests for +both marker styles, with and without whitespace and newlines, and verify the +other comment policies remain unchanged. + +`comments: 'all'` is an existing documented option and preserves these comments. +Preserving all source comments is a reasonable compiler policy independently of +this defect. No special annotation-repair workaround has been added here. + +## Initial feasibility evidence + +### Invalid AST robustness report + +`invalid-method-repro.mjs` deliberately replaces an object method's +`FunctionExpression` value with a `CallExpression` while retaining `method: true`. +This inconsistent AST originated in an early migration implementation and is +fixed in the compiler by retaining method/accessor semantics. Yuku 0.11.0 codegen +terminates its process with `SIGBUS` (null exit status, no stderr) on macOS arm64 +for this input. Run it with a dependency directory argument; a parent process +captures the crash safely. This is invalid-input hardening, **not** a supported +syntax defect or migration blocker. Proposed upstream improvement: validate +method/accessor value shapes at the native boundary and return a diagnostic +instead of terminating the host process. + +The initial corpus contained 115 input fixtures: 72 from router-plugin (including +all 52 route-splitting fixtures) and 43 from start-plugin-core. Each was analyzed, +cloned with `structuredClone`, printed, and independently parsed by Babel. +Normalized Babel ASTs matched their original input ASTs after excluding source +locations, comments, and parser metadata. This establishes structural syntax +roundtrip fidelity, **not** the correctness of a migrated transform pipeline. + +Focused public-API checks passed for JSX component references and shadowing, +closure captures and writes, nested shadowing, TypeScript enum-member resolution, +type-only references, generated expression precedence, and cloned output edits +that leave the original AST/semantic analysis intact. A separate comment movement +check confirmed that explicit full-comment printing moves annotations with their +AST nodes and removes them with deleted nodes. + +Unicode checks used astral and accented characters. AST `start`/`end` values use +JavaScript UTF-16 offsets, while flat comment spans are documented as byte offsets. +Generated source-map mappings resolved sampled identifier locations correctly +through `@jridgewell/trace-mapping` 0.3.31. Consumers must not conflate the different +span APIs. This is a smoke check, not exhaustive source-map validation. + +Supported syntax probes included import attributes and deprecated import asserts, +explicit resource management, generic TSX arrows, TypeScript angle-bracket +assertions, type imports/exports, and decorators. Yuku can move a decorator from +before `export` to after `export`; downstream parser settings must accept valid +output independent of the old Babel-specific configuration. + +The native packages advertise macOS x64/arm64, Windows x64/arm64, Linux +x64/arm64/arm GNU and musl, FreeBSD x64, and Android arm64 binaries. Only macOS +arm64 was executed here. The packages are ESM and declare no Node `engines` +constraint. A SHA-256-verified official Node 20.19.0 binary also successfully +loaded the built router-utils CommonJS entry point and exercised its public +analyze/clone/generate helpers, the router-plugin Vite factory initialization, +and the router-generator `Generator` export. A separately verified official +Node 22.12.0 binary loaded Start's built public ESM and Vite entrypoints and +exercised native analysis, cloning, and generation of TypeScript generic syntax. +Node 24.8.0 drives the normal workspace checks; other native platforms remain +unverified in this environment. diff --git a/benchmarks/compiler/yuku-feasibility/invalid-method-repro.mjs b/benchmarks/compiler/yuku-feasibility/invalid-method-repro.mjs new file mode 100644 index 00000000000..9620c830ef6 --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/invalid-method-repro.mjs @@ -0,0 +1,52 @@ +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { createRequire } from 'node:module' +import path from 'node:path' +import { pathToFileURL } from 'node:url' + +// Invalid-input hardening report, not a supported-AST/codegen defect. +// Run in a child because native codegen may terminate the process. +const dependencyRoot = process.argv[2] +assert( + dependencyRoot, + 'Usage: node invalid-method-repro.mjs /path/to/dependencies', +) +if (process.argv[3] !== '--child') { + const result = spawnSync( + process.execPath, + [process.argv[1], dependencyRoot, '--child'], + { encoding: 'utf8' }, + ) + console.log( + JSON.stringify( + { + status: result.status, + signal: result.signal, + stdout: result.stdout, + stderr: result.stderr, + }, + null, + 2, + ), + ) +} else { + const require = createRequire( + path.join(path.resolve(dependencyRoot), 'package.json'), + ) + const { parse } = await import(pathToFileURL(require.resolve('yuku-parser'))) + const { generate } = await import( + pathToFileURL(require.resolve('yuku-codegen')) + ) + const { program } = parse('const route = { loader() { return 1 } };') + // Caller mistake: method:true requires a FunctionExpression value. + const property = program.body[0].declarations[0].init.properties[0] + property.value = { + type: 'CallExpression', + start: 0, + end: 0, + callee: { type: 'Identifier', start: 0, end: 0, name: 'lazy' }, + arguments: [], + optional: false, + } + console.log(generate(program)) +} diff --git a/benchmarks/compiler/yuku-feasibility/pure-comment-repro.mjs b/benchmarks/compiler/yuku-feasibility/pure-comment-repro.mjs new file mode 100644 index 00000000000..80084a5b141 --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/pure-comment-repro.mjs @@ -0,0 +1,27 @@ +import assert from 'node:assert/strict' +import { createRequire } from 'node:module' +import path from 'node:path' +import { pathToFileURL } from 'node:url' + +// Point at a scratch install so the experiment does not alter workspace deps. +const dependencyRoot = process.argv[2] +assert( + dependencyRoot, + 'Usage: node pure-comment-repro.mjs /path/to/scratch-install', +) +const require = createRequire( + path.join(path.resolve(dependencyRoot), 'package.json'), +) +const { parse } = await import(pathToFileURL(require.resolve('yuku-parser'))) +const { generate } = await import( + pathToFileURL(require.resolve('yuku-codegen')) +) +const source = 'const value = /* @__PURE__ */ factory();' +const { program } = parse(source, { attachComments: true }) +const { code } = generate(program) +console.log(JSON.stringify({ source, actual: code }, null, 2)) +assert.match( + code, + /@__PURE__/, + 'The default comment policy must preserve purity annotations', +) diff --git a/packages/router-plugin/tests/code-splitter-runtime.test.ts b/packages/router-plugin/tests/code-splitter-runtime.test.ts index 0eb9b52ea54..a0f17070ad9 100644 --- a/packages/router-plugin/tests/code-splitter-runtime.test.ts +++ b/packages/router-plugin/tests/code-splitter-runtime.test.ts @@ -1,5 +1,12 @@ import { execFile } from 'node:child_process' -import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' +import { + copyFile, + mkdir, + mkdtemp, + readFile, + rm, + writeFile, +} from 'node:fs/promises' import path from 'node:path' import { promisify } from 'node:util' import { pathToFileURL } from 'node:url' @@ -14,120 +21,78 @@ const fixture = path.resolve( 'code-splitter/test-files/react/shared-runtime.tsx', ) -const groupings: Array<{ name: string; groupings: CodeSplitGroupings }> = [ +it.each([ { name: 'eager loader', groupings: [['component']] }, { name: 'separate lazy loader', groupings: [['component'], ['loader']] }, { name: 'combined lazy loader', groupings: [['component', 'loader']] }, -] - -it.each(groupings)( +])( 'preserves executable route contracts with $name', - assertRuntimeContracts, - 30_000, -) - -// Shared extraction currently duplicates named default function declarations and -// drops TypeScript enum/namespace dependencies. Keep their intended contracts. -it.fails.each(['named-default', 'enum', 'namespace'] as const)( - 'preserves executable route contracts with shared %s declarations', - async (syntax) => { - await assertRuntimeContracts({ - groupings: [['component'], ['loader']], - syntax, - }) - }, - 30_000, -) - -async function assertRuntimeContracts({ - groupings, - syntax, -}: { - groupings: CodeSplitGroupings - syntax?: 'named-default' | 'enum' | 'namespace' -}) { - // Keep the temporary app inside the package so real runtime imports resolve. - const root = await mkdtemp(path.join(__dirname, '.runtime-contract-')) - try { - await mkdir(path.join(root, 'routes')) - let source = await readFile(fixture, 'utf8') - if (syntax === 'named-default') { - source = source - .replace( - 'function createSeed()', - 'export default function createSeed()', - ) - .replace('export default createSeed', '') - } else if (syntax === 'enum') { - source = source.replace( - 'const Count = { Initial: 0 }', - 'enum Count { Initial = 0 }', - ) - } else if (syntax === 'namespace') { - source = source.replace( - "const Labels = { component: 'count' }", - "namespace Labels { export const component = 'count' }", - ) - } - await writeFile(path.join(root, 'routes/shared-runtime.tsx'), source) - await writeFile( - path.join(root, 'routes/__root.tsx'), - `import { createRootRoute } from '@tanstack/react-router' + async ({ groupings }) => { + // Keep the temporary app inside the package so real runtime imports resolve. + const root = await mkdtemp(path.join(__dirname, '.runtime-contract-')) + try { + await mkdir(path.join(root, 'routes')) + await copyFile(fixture, path.join(root, 'routes/shared-runtime.tsx')) + await writeFile( + path.join(root, 'routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router' export const Route = createRootRoute({})`, - ) - await writeFile( - path.join(root, 'entry.ts'), - `import { createElement } from 'react' + ) + await writeFile( + path.join(root, 'entry.ts'), + `import { createElement } from 'react' import { renderToString } from 'react-dom/server' import { Route } from './routes/shared-runtime' export { Route, firstState, secondState, 'odd-name' } from './routes/shared-runtime' export function render() { return renderToString(createElement(Route.options.component)) }`, - ) + ) - await build({ - root, - configFile: false, - logLevel: 'silent', - plugins: [ - tanstackRouter({ - target: 'react', - routesDirectory: './routes', - generatedRouteTree: './routeTree.gen.ts', - autoCodeSplitting: true, - codeSplittingOptions: { - addHmr: false, - defaultBehavior: groupings, - }, - }), - ], - build: { - ssr: path.join(root, 'entry.ts'), - outDir: 'dist', - minify: false, - sourcemap: true, - rollupOptions: { - output: { - entryFileNames: 'entry.mjs', - chunkFileNames: '[name].mjs', + await build({ + root, + configFile: false, + logLevel: 'silent', + plugins: [ + tanstackRouter({ + target: 'react', + routesDirectory: './routes', + generatedRouteTree: './routeTree.gen.ts', + autoCodeSplitting: true, + codeSplittingOptions: { + addHmr: false, + defaultBehavior: groupings as CodeSplitGroupings, + }, + }), + ], + build: { + ssr: path.join(root, 'entry.ts'), + outDir: 'dist', + minify: false, + sourcemap: true, + rollupOptions: { + output: { + entryFileNames: 'entry.mjs', + chunkFileNames: '[name].mjs', + }, }, }, - }, - }) + }) - const throwLine = - source.split('\n').findIndex((line) => line.includes('throw new Error')) + - 1 - const entryUrl = pathToFileURL(path.join(root, 'dist/entry.mjs')).href - const combined = groupings.some( - (group) => group.includes('component') && group.includes('loader'), - ) - const { stdout } = await runNode(process.execPath, [ - '--enable-source-maps', - '--input-type=module', - '--eval', - `import assert from 'node:assert/strict' + const source = await readFile(fixture, 'utf8') + const throwLine = + source + .split('\n') + .findIndex((line) => line.includes('throw new Error')) + 1 + const entryUrl = pathToFileURL(path.join(root, 'dist/entry.mjs')).href + const combined = groupings.some( + (group) => group.includes('component') && group.includes('loader'), + ) + const { stdout } = await runNode(process.execPath, [ + '--enable-source-maps', + '--input-type=module', + '--eval', + `import assert from 'node:assert/strict' const messages = [] console.log = (message) => messages.push(message) const { Route, render, firstState, secondState, 'odd-name': oddState } = await import(${JSON.stringify(entryUrl)}) @@ -153,9 +118,11 @@ assert.throws(render, (error) => { return true }) process.stdout.write('route contracts passed')`, - ]) - expect(stdout).toBe('route contracts passed') - } finally { - await rm(root, { recursive: true, force: true }) - } -} + ]) + expect(stdout).toBe('route contracts passed') + } finally { + await rm(root, { recursive: true, force: true }) + } + }, + 30_000, +) diff --git a/packages/router-plugin/tests/code-splitter/test-files/react/shared-runtime.tsx b/packages/router-plugin/tests/code-splitter/test-files/react/shared-runtime.tsx index f9fd708a0ba..46e70006788 100644 --- a/packages/router-plugin/tests/code-splitter/test-files/react/shared-runtime.tsx +++ b/packages/router-plugin/tests/code-splitter/test-files/react/shared-runtime.tsx @@ -1,8 +1,12 @@ import { createFileRoute } from '@tanstack/react-router' -const Count = { Initial: 0 } +enum Count { + Initial = 0, +} -const Labels = { component: 'count' } +namespace Labels { + export const component = 'count' +} const seed = createSeed() const { state, increment } = createState(seed) @@ -23,7 +27,7 @@ export const Route = createFileRoute('/shared-runtime')({ }, }) -function createSeed() { +export default function createSeed() { console.log('shared-runtime:seed') return { count: Count.Initial, label: Labels.component } } @@ -46,5 +50,3 @@ function createComponentLabel() { } export { state as firstState, state as secondState, state as 'odd-name' } - -export default createSeed diff --git a/packages/router-plugin/tests/hmr-exports.test.ts b/packages/router-plugin/tests/hmr-exports.test.ts new file mode 100644 index 00000000000..1a650ee388a --- /dev/null +++ b/packages/router-plugin/tests/hmr-exports.test.ts @@ -0,0 +1,121 @@ +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' +import path from 'node:path' +import { createServer } from 'vite' +import { describe, expect, it } from 'vitest' +import { tanstackRouter } from '../src/vite' + +describe.each([true, false])( + 'React HMR with autoCodeSplitting=%s', + (autoCodeSplitting) => { + it.each([ + [ + 'function', + 'export function component() { return null }', + 'component', + 'component', + ], + [ + 'overloaded function', + 'export function component(): null; export function component() { return null }', + 'component', + 'component', + ], + [ + 'shared function', + 'export function component() { return null }', + 'component', + 'component, errorComponent: component', + ], + [ + 'variable', + 'export const component = () => null', + 'component', + 'component', + ], + ['class', 'export class component {}', 'component', 'component'], + [ + 'multiple variables', + 'export const component = () => null, pendingComponent = () => null', + 'component', + 'component, pendingComponent', + ], + [ + 'explicit alias', + 'function component() { return null }; export { component as View }', + 'View', + 'component', + ], + [ + 'default', + 'export default function component() { return null }', + 'default', + 'component', + ], + ])( + 'preserves the %s component export with React HMR', + async (_, declaration, exportName, routeOptions) => { + const root = await mkdtemp(path.join(__dirname, '.hmr-exports-')) + let server: Awaited> | undefined + try { + await mkdir(path.join(root, 'routes')) + await writeFile( + path.join(root, 'routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute({})`, + ) + await writeFile( + path.join(root, 'routes/page.tsx'), + `import { createFileRoute } from '@tanstack/react-router' +${declaration} +export function helper(value: string): string +export function helper(value: number): number +export function helper(value: string | number) { return value } +export { helper as helperAlias } +export const Route = createFileRoute('/page')({ + ${routeOptions}, + beforeLoad: () => helper('before'), + loader: () => helper(42), +})`, + ) + server = await createServer({ + root, + configFile: false, + logLevel: 'silent', + plugins: [ + tanstackRouter({ + target: 'react', + autoCodeSplitting, + codeSplittingOptions: { + defaultBehavior: [['component'], ['loader']], + }, + routesDirectory: './routes', + generatedRouteTree: './routeTree.gen.ts', + }), + ], + server: { middlewareMode: true }, + appType: 'custom', + }) + const transformed = await server.transformRequest('/routes/page.tsx') + expect(transformed?.code).toContain('TSRFastRefreshAnchor') + const routeModule = await server.ssrLoadModule('/routes/page.tsx') + expect(routeModule).toHaveProperty(exportName) + expect(routeModule[exportName]).toBe( + routeModule.Route.options.component, + ) + expect(routeModule.helperAlias).toBe(routeModule.helper) + expect(routeModule.Route.options.beforeLoad()).toBe('before') + expect(await routeModule.Route.options.loader()).toBe(42) + if (routeOptions.includes('pendingComponent')) { + expect(routeModule.pendingComponent).toBe( + routeModule.Route.options.pendingComponent, + ) + } + } finally { + await server?.close() + await rm(root, { recursive: true, force: true }) + } + }, + 30_000, + ) + }, +) From 7870d28e02094c382f24cdd64e6d0a08f5d076d2 Mon Sep 17 00:00:00 2001 From: Sheraff Date: Sat, 26 Sep 2026 16:42:27 +0200 Subject: [PATCH 002/152] test: record final compiler migration measurements --- benchmarks/compiler/README.md | 92 + benchmarks/compiler/compare.mjs | 101 + benchmarks/compiler/process-tree.mjs | 7 + .../compiler/results/final-alternating.json | 2469 +++++++++++++++++ .../results/final-bindings-1000-baseline.json | 197 ++ .../final-bindings-1000-candidate.json | 203 ++ .../results/final-cache-250-128-profile.json | 330 +++ .../results/final-cache-250-128-timing.json | 117 + .../results/final-cache-250-256-profile.json | 330 +++ .../results/final-cache-250-256-timing.json | 117 + .../results/final-cache-250-512-profile.json | 330 +++ .../results/final-cache-250-512-timing.json | 117 + .../results/final-cache-750-128-profile.json | 830 ++++++ .../results/final-cache-750-128-timing.json | 117 + .../results/final-cache-750-256-profile.json | 830 ++++++ .../results/final-cache-750-256-timing.json | 117 + .../results/final-cache-750-512-profile.json | 830 ++++++ .../results/final-cache-750-512-timing.json | 117 + .../final-hydrate-client-baseline.json | 171 ++ .../final-hydrate-client-candidate.json | 173 ++ .../final-hydrate-server-baseline.json | 171 ++ .../final-hydrate-server-candidate.json | 173 ++ .../final-process-tree-routes-baseline.json | 49 + .../final-process-tree-routes-candidate.json | 51 + .../final-process-tree-start-baseline.json | 50 + .../final-process-tree-start-candidate.json | 52 + .../compiler/results/final-reuse-digest.json | 181 ++ benchmarks/compiler/results/final-reuse.json | 573 ++++ benchmarks/compiler/route-heavy.mjs | 1 + 29 files changed, 8896 insertions(+) create mode 100644 benchmarks/compiler/compare.mjs create mode 100644 benchmarks/compiler/results/final-alternating.json create mode 100644 benchmarks/compiler/results/final-bindings-1000-baseline.json create mode 100644 benchmarks/compiler/results/final-bindings-1000-candidate.json create mode 100644 benchmarks/compiler/results/final-cache-250-128-profile.json create mode 100644 benchmarks/compiler/results/final-cache-250-128-timing.json create mode 100644 benchmarks/compiler/results/final-cache-250-256-profile.json create mode 100644 benchmarks/compiler/results/final-cache-250-256-timing.json create mode 100644 benchmarks/compiler/results/final-cache-250-512-profile.json create mode 100644 benchmarks/compiler/results/final-cache-250-512-timing.json create mode 100644 benchmarks/compiler/results/final-cache-750-128-profile.json create mode 100644 benchmarks/compiler/results/final-cache-750-128-timing.json create mode 100644 benchmarks/compiler/results/final-cache-750-256-profile.json create mode 100644 benchmarks/compiler/results/final-cache-750-256-timing.json create mode 100644 benchmarks/compiler/results/final-cache-750-512-profile.json create mode 100644 benchmarks/compiler/results/final-cache-750-512-timing.json create mode 100644 benchmarks/compiler/results/final-hydrate-client-baseline.json create mode 100644 benchmarks/compiler/results/final-hydrate-client-candidate.json create mode 100644 benchmarks/compiler/results/final-hydrate-server-baseline.json create mode 100644 benchmarks/compiler/results/final-hydrate-server-candidate.json create mode 100644 benchmarks/compiler/results/final-process-tree-routes-baseline.json create mode 100644 benchmarks/compiler/results/final-process-tree-routes-candidate.json create mode 100644 benchmarks/compiler/results/final-process-tree-start-baseline.json create mode 100644 benchmarks/compiler/results/final-process-tree-start-candidate.json create mode 100644 benchmarks/compiler/results/final-reuse-digest.json create mode 100644 benchmarks/compiler/results/final-reuse.json diff --git a/benchmarks/compiler/README.md b/benchmarks/compiler/README.md index 752c2ade4d1..4f5031b2d5f 100644 --- a/benchmarks/compiler/README.md +++ b/benchmarks/compiler/README.md @@ -5,6 +5,94 @@ comparison from the complete existing route splitter and actual Vite builds. They are not CodSpeed runtime benchmarks. A faster toolkit roundtrip does not establish an equivalent speedup in a migrated compiler or application build. +## Final migration evaluation + +After correctness fixes and application validation, five baseline/native pairs +were run in a quiet window. The order alternates AB/BA between repetitions for +each workload. `results/final-alternating.json` records every sample, order, +source hash, compiler source/dist fingerprint, dependency version, and Git HEAD. +Both checkouts have supporting commit `0ec43cd02c`; the baseline compiler source +is unchanged from `bb4423e`. Node 24.8.0 ran on an Apple M3 Max. + +| Workload | Babel median (min–max), ms | Native median (min–max), ms | Time reduction | Median peak process RSS, Babel → native | +| ------------------------------------------------------------------ | -------------------------: | --------------------------: | -------------: | --------------------------------------: | +| Complete 52-fixture splitter, three configurations | 295.71 (294.85–302.86) | 88.70 (88.11–90.38) | 70.0% | 397.3 → 200.7 MiB | +| Synthetic 250-route production Vite build | 1807.10 (1720.87–1871.08) | 1054.69 (1043.91–1104.89) | 41.6% | 732.9 → 647.8 MiB | +| React Start server-functions production app, all Vite environments | 1530.60 (1467.79–1571.32) | 1038.35 (1013.42–1074.08) | 32.2% | 658.7 → 545.6 MiB | + +The splitter uses two warmups and ten measured corpus passes per fresh worker. +It produces 517 modules in both engines, with 858 versus 156 full-source +analyses per corpus. Both synthetic builds emit 751 chunks and 722,613 JS bytes. +The real Start app emits 1,214,457 versus 1,208,118 JS bytes; matching output +text is not required. All corresponding input hashes match. Builds exclude +Nx orchestration and the separate TypeScript check; both apps were first built +through their Nx targets. These results describe the measured workloads, not a +guaranteed speedup for every application. + +Reproduce paired measurements after building both workspaces: + +```sh +node benchmarks/compiler/compare.mjs --baseline /path/to/baseline --fixtures-root /path/to/frozen-original-52-fixtures --output final-alternating.json +``` + +The fixed comparison corpus is the original 52 fixture files, SHA-256 +`db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e`. +New native-only syntax fixtures are excluded from both comparative engines. + +Separate native reuse attribution (five workers, two warmups, ten passes) +measured 91.69 ms with reuse versus 130.85 ms without it, a 29.9% reduction; +peak process RSS was 199.0 versus 335.0 MiB. A diagnostic-only run hashes the +complete generated code and source maps and confirms identical hashes in both +modes. See `final-reuse.json` and `final-reuse-digest.json`. + +Separate 50 ms process-tree sampling observed no child processes during either +workload in either checkout (26–46 samples per run). Sampled tree peaks were +751.3 → 633.8 MiB for 250 routes and 655.4 → 554.4 MiB for Start. These are +single instrumented diagnostics, not additional speed samples; short-lived +processes or peaks between samples could be missed. Kernel-reported worker +peaks are retained alongside them in `final-process-tree-*.json`. + +The bounded cache remains 128 entries. Three fresh speed workers per variant, +plus separate analyzer-call/live-memory diagnostics, produced: + +| Routes | Cache entries limit | Median build ms | Median peak RSS MiB | Full-source analyzer calls | Heap released by cache clear MiB | +| -----: | ------------------: | --------------: | ------------------: | -------------------------: | -------------------------------: | +| 250 | 128 | 1109.41 | 658.1 | 751 | 7.3 | +| 250 | 256 | 1028.04 | 624.1 | 251 | 14.2 | +| 250 | 512 | 1040.04 | 643.0 | 251 | 14.2 | +| 750 | 128 | 2782.43 | 1108.8 | 2251 | 7.9 | +| 750 | 256 | 2783.74 | 1136.6 | 2251 | 14.8 | +| 750 | 512 | 2689.50 | 1153.0 | 1501 | 28.6 | + +The 256-entry cache helps the fitting 250-route case, but provides no measured +speed gain at 750 routes and retains more live memory. At 750 routes, 512 entries +save only 3.3% build time while peak RSS rises 4.0%. This does not justify changing +the default. Reuse is opportunistic: 128 entries still analyze each route three +times in the measured production request order. The cache is cleared at build +end. Heap deltas around explicit GC are observations, not attribution of every +native allocation; RSS need not fall when the allocator retains freed pages. +See `final-cache-*-timing.json` and `final-cache-*-profile.json`. + +Final dense-module checks also remain faster and use less peak process memory: + +| Workload | Babel median ms | Native median ms | Median peak RSS, Babel → native | +| -------------------------------------------------------------- | --------------: | ---------------: | ------------------------------: | +| 100 bound Hydrate spreads, client | 19.95 | 12.60 | 125.8 → 89.3 MiB | +| 500 bound Hydrate spreads, client | 70.50 | 52.46 | 265.3 → 153.0 MiB | +| 100 bound Hydrate spreads, server | 16.32 | 8.16 | 121.2 → 78.8 MiB | +| 500 bound Hydrate spreads, server | 46.79 | 36.20 | 203.3 → 122.5 MiB | +| 1,000 shared destructured bindings, three split configurations | 3793.85 | 187.40 | 354.9 → 166.5 MiB | + +These are three fresh workers per engine, one warmup, and three Hydrate compiles +or two splitter corpus passes per worker. They are sequential baseline/native +stress comparisons, separate from the alternating main workloads. Source hashes +and output counts match between engines. See `final-hydrate-*.json` and +`final-bindings-1000-*.json`. The earlier before/after files retain evidence for +the two measured scaling optimizations. + +The earlier sections below preserve exploratory and optimization measurements; +the final paired comparison above is the main adoption evidence. + Use the Node version in `.nvmrc` and the root pnpm version. Build both workspaces through Nx before timing: workspace package imports consume `dist`. The default modes benchmark the native compiler; select Babel modes against a baseline checkout. @@ -45,6 +133,10 @@ these settings. A corpus hash protects against fixture edits during a run. - `yuku-splitter-no-reuse`: omit the optional analysis from each native compiler entry point to attribute the separate effect of analysis reuse. +`--digest-output` separately hashes every generated code string and serialized +source map to check reuse/no-reuse output identity. It marks the result as a +diagnostic; do not use these instrumented samples for speed comparisons. + Phase times include normal allocations and GC. Process wall time additionally includes module loading, fixture loading, warmups, explicit GC, and process startup/exit. `process.resourceUsage().maxRSS` is the peak process resident size, diff --git a/benchmarks/compiler/compare.mjs b/benchmarks/compiler/compare.mjs new file mode 100644 index 00000000000..c8ac44ba71e --- /dev/null +++ b/benchmarks/compiler/compare.mjs @@ -0,0 +1,101 @@ +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { writeFileSync } from 'node:fs' +import { fileURLToPath } from 'node:url' + +// Alternate whole-workload runs between checkouts; every sample still gets +// the fresh worker process provided by its existing workload harness. +const args = process.argv.slice(2) +function option(name, fallback) { + const index = args.indexOf(name) + return index < 0 ? fallback : args[index + 1] +} +const baseline = option('--baseline') +const candidate = option( + '--candidate', + fileURLToPath(new URL('../../', import.meta.url)), +) +const fixtures = option('--fixtures-root') +const output = option('--output') +const repetitions = Number(option('--repetitions', '5')) +const iterations = Number(option('--iterations', '10')) +assert.ok(baseline && fixtures && output) +assert.ok(Number.isSafeInteger(repetitions) && repetitions > 0) +assert.ok(Number.isSafeInteger(iterations) && iterations > 0) +const workloads = { + splitter: { + script: 'measure.mjs', + parameters: (engine) => [ + '--fixtures-root', + fixtures, + '--iterations', + String(iterations), + '--warmups', + '2', + '--modes', + engine === 'baseline' ? 'babel-splitter' : 'yuku-splitter', + ], + }, + routes: { + script: 'route-heavy.mjs', + parameters: () => ['--routes', '250'], + }, + start: { + script: 'build.mjs', + parameters: () => ['--app', 'e2e/react-start/server-functions'], + }, +} +const result = { + timestamp: new Date().toISOString(), + node: process.version, + repetitions, + iterations, + complete: false, + order: [], + workloads: Object.fromEntries( + Object.keys(workloads).map((name) => [ + name, + { baseline: [], candidate: [] }, + ]), + ), +} +for (let repetition = 0; repetition < repetitions; repetition++) { + const engines = + repetition % 2 ? ['candidate', 'baseline'] : ['baseline', 'candidate'] + for (const [name, workload] of Object.entries(workloads)) { + for (const engine of engines) { + const started = new Date().toISOString() + const execution = spawnSync( + process.execPath, + [ + fileURLToPath(new URL(workload.script, import.meta.url)), + '--workspace', + engine === 'baseline' ? baseline : candidate, + '--repetitions', + '1', + ...workload.parameters(engine), + ], + { encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 }, + ) + assert.equal( + execution.status, + 0, + `${execution.stdout}\n${execution.stderr}`, + ) + result.workloads[name][engine].push(JSON.parse(execution.stdout)) + result.order.push({ + repetition, + workload: name, + engine, + started, + finished: new Date().toISOString(), + }) + writeFileSync(output, `${JSON.stringify(result, null, 2)}\n`) + process.stderr.write( + `${repetition + 1}/${repetitions} ${name} ${engine} completed\n`, + ) + } + } +} +result.complete = true +writeFileSync(output, `${JSON.stringify(result, null, 2)}\n`) diff --git a/benchmarks/compiler/process-tree.mjs b/benchmarks/compiler/process-tree.mjs index c28cc2b5c7f..0e1355f1e0c 100644 --- a/benchmarks/compiler/process-tree.mjs +++ b/benchmarks/compiler/process-tree.mjs @@ -1,10 +1,16 @@ import assert from 'node:assert/strict' import { spawn, spawnSync } from 'node:child_process' import { fileURLToPath } from 'node:url' +import { compilerFingerprint } from './provenance.mjs' // Separate diagnostic run: ps sampling deliberately stays outside speed runs. const args = process.argv.slice(2) const script = args.shift() +const workspaceArgument = args.indexOf('--workspace') +const workspace = + workspaceArgument < 0 + ? fileURLToPath(new URL('../../', import.meta.url)) + : args[workspaceArgument + 1] assert.ok( script, 'Usage: node process-tree.mjs [args]', @@ -102,6 +108,7 @@ console.log( { timestamp: new Date().toISOString(), node: process.version, + compilerFingerprint: compilerFingerprint(workspace), diagnosticOnly: true, sampleIntervalMs: 50, samples, diff --git a/benchmarks/compiler/results/final-alternating.json b/benchmarks/compiler/results/final-alternating.json new file mode 100644 index 00000000000..f8886a597e6 --- /dev/null +++ b/benchmarks/compiler/results/final-alternating.json @@ -0,0 +1,2469 @@ +{ + "timestamp": "2026-09-26T14:35:40.757Z", + "node": "v24.8.0", + "repetitions": 5, + "iterations": 10, + "complete": true, + "order": [ + { + "repetition": 0, + "workload": "splitter", + "engine": "baseline", + "started": "2026-09-26T14:35:40.758Z", + "finished": "2026-09-26T14:35:44.760Z" + }, + { + "repetition": 0, + "workload": "splitter", + "engine": "candidate", + "started": "2026-09-26T14:35:44.761Z", + "finished": "2026-09-26T14:35:45.962Z" + }, + { + "repetition": 0, + "workload": "routes", + "engine": "baseline", + "started": "2026-09-26T14:35:45.963Z", + "finished": "2026-09-26T14:35:48.250Z" + }, + { + "repetition": 0, + "workload": "routes", + "engine": "candidate", + "started": "2026-09-26T14:35:48.250Z", + "finished": "2026-09-26T14:35:49.631Z" + }, + { + "repetition": 0, + "workload": "start", + "engine": "baseline", + "started": "2026-09-26T14:35:49.631Z", + "finished": "2026-09-26T14:35:51.414Z" + }, + { + "repetition": 0, + "workload": "start", + "engine": "candidate", + "started": "2026-09-26T14:35:51.414Z", + "finished": "2026-09-26T14:35:52.654Z" + }, + { + "repetition": 1, + "workload": "splitter", + "engine": "candidate", + "started": "2026-09-26T14:35:52.654Z", + "finished": "2026-09-26T14:35:53.868Z" + }, + { + "repetition": 1, + "workload": "splitter", + "engine": "baseline", + "started": "2026-09-26T14:35:53.869Z", + "finished": "2026-09-26T14:35:57.715Z" + }, + { + "repetition": 1, + "workload": "routes", + "engine": "candidate", + "started": "2026-09-26T14:35:57.716Z", + "finished": "2026-09-26T14:35:59.117Z" + }, + { + "repetition": 1, + "workload": "routes", + "engine": "baseline", + "started": "2026-09-26T14:35:59.117Z", + "finished": "2026-09-26T14:36:01.355Z" + }, + { + "repetition": 1, + "workload": "start", + "engine": "candidate", + "started": "2026-09-26T14:36:01.355Z", + "finished": "2026-09-26T14:36:02.544Z" + }, + { + "repetition": 1, + "workload": "start", + "engine": "baseline", + "started": "2026-09-26T14:36:02.544Z", + "finished": "2026-09-26T14:36:04.235Z" + }, + { + "repetition": 2, + "workload": "splitter", + "engine": "baseline", + "started": "2026-09-26T14:36:04.235Z", + "finished": "2026-09-26T14:36:08.095Z" + }, + { + "repetition": 2, + "workload": "splitter", + "engine": "candidate", + "started": "2026-09-26T14:36:08.095Z", + "finished": "2026-09-26T14:36:09.331Z" + }, + { + "repetition": 2, + "workload": "routes", + "engine": "baseline", + "started": "2026-09-26T14:36:09.331Z", + "finished": "2026-09-26T14:36:11.551Z" + }, + { + "repetition": 2, + "workload": "routes", + "engine": "candidate", + "started": "2026-09-26T14:36:11.552Z", + "finished": "2026-09-26T14:36:12.923Z" + }, + { + "repetition": 2, + "workload": "start", + "engine": "baseline", + "started": "2026-09-26T14:36:12.923Z", + "finished": "2026-09-26T14:36:14.688Z" + }, + { + "repetition": 2, + "workload": "start", + "engine": "candidate", + "started": "2026-09-26T14:36:14.688Z", + "finished": "2026-09-26T14:36:15.906Z" + }, + { + "repetition": 3, + "workload": "splitter", + "engine": "candidate", + "started": "2026-09-26T14:36:15.907Z", + "finished": "2026-09-26T14:36:17.128Z" + }, + { + "repetition": 3, + "workload": "splitter", + "engine": "baseline", + "started": "2026-09-26T14:36:17.129Z", + "finished": "2026-09-26T14:36:20.974Z" + }, + { + "repetition": 3, + "workload": "routes", + "engine": "candidate", + "started": "2026-09-26T14:36:20.975Z", + "finished": "2026-09-26T14:36:22.343Z" + }, + { + "repetition": 3, + "workload": "routes", + "engine": "baseline", + "started": "2026-09-26T14:36:22.343Z", + "finished": "2026-09-26T14:36:24.466Z" + }, + { + "repetition": 3, + "workload": "start", + "engine": "candidate", + "started": "2026-09-26T14:36:24.466Z", + "finished": "2026-09-26T14:36:25.656Z" + }, + { + "repetition": 3, + "workload": "start", + "engine": "baseline", + "started": "2026-09-26T14:36:25.656Z", + "finished": "2026-09-26T14:36:27.327Z" + }, + { + "repetition": 4, + "workload": "splitter", + "engine": "baseline", + "started": "2026-09-26T14:36:27.327Z", + "finished": "2026-09-26T14:36:31.180Z" + }, + { + "repetition": 4, + "workload": "splitter", + "engine": "candidate", + "started": "2026-09-26T14:36:31.180Z", + "finished": "2026-09-26T14:36:32.387Z" + }, + { + "repetition": 4, + "workload": "routes", + "engine": "baseline", + "started": "2026-09-26T14:36:32.387Z", + "finished": "2026-09-26T14:36:34.534Z" + }, + { + "repetition": 4, + "workload": "routes", + "engine": "candidate", + "started": "2026-09-26T14:36:34.535Z", + "finished": "2026-09-26T14:36:35.971Z" + }, + { + "repetition": 4, + "workload": "start", + "engine": "baseline", + "started": "2026-09-26T14:36:35.971Z", + "finished": "2026-09-26T14:36:37.710Z" + }, + { + "repetition": 4, + "workload": "start", + "engine": "candidate", + "started": "2026-09-26T14:36:37.710Z", + "finished": "2026-09-26T14:36:38.968Z" + } + ], + "workloads": { + "splitter": { + "baseline": [ + { + "timestamp": "2026-09-26T14:35:44.735Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 302.8551292, + "minMsPerCorpus": 302.8551292, + "maxMsPerCorpus": 302.8551292, + "medianPeakRssMiB": 414.46875, + "medianRetainedHeapMiB": 22.722915649414062, + "medianWallMs": 3943.986375, + "phasesMsPerCorpus": { + "detectGroupings": 27.86601220000025, + "sharedAnalysis": 24.28284150000013, + "referenceCompile": 111.01037360000036, + "virtualCompile": 130.9008997000013, + "sharedCompile": 7.424220300000252 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 3943.986375, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 3028.551292, + "phases": { + "detectGroupings": 278.6601220000025, + "sharedAnalysis": 242.8284150000013, + "referenceCompile": 1110.1037360000037, + "virtualCompile": 1309.008997000013, + "sharedCompile": 74.24220300000252 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 424416, + "before": { + "rss": 315768832, + "heapTotal": 187432960, + "heapUsed": 22855048, + "external": 3290714, + "arrayBuffers": 24947 + }, + "after": { + "rss": 434585600, + "heapTotal": 236584960, + "heapUsed": 79275704, + "external": 2661982, + "arrayBuffers": 352627 + }, + "retained": { + "rss": 434601984, + "heapTotal": 189136896, + "heapUsed": 23826704, + "external": 2659415, + "arrayBuffers": 24947 + }, + "outputBytes": 1681176, + "outputMapBytes": 6961704, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:35:57.694Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 295.9130333, + "minMsPerCorpus": 295.9130333, + "maxMsPerCorpus": 295.9130333, + "medianPeakRssMiB": 397.890625, + "medianRetainedHeapMiB": 22.707908630371094, + "medianWallMs": 3799.060625, + "phasesMsPerCorpus": { + "detectGroupings": 22.563954499999728, + "sharedAnalysis": 21.318069700000116, + "referenceCompile": 106.71074460000159, + "virtualCompile": 136.42609449999958, + "sharedCompile": 7.549207400000023 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 3799.060625, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 2959.130333, + "phases": { + "detectGroupings": 225.63954499999727, + "sharedAnalysis": 213.18069700000115, + "referenceCompile": 1067.107446000016, + "virtualCompile": 1364.260944999996, + "sharedCompile": 75.49207400000023 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 407440, + "before": { + "rss": 302514176, + "heapTotal": 189792256, + "heapUsed": 22841048, + "external": 3290714, + "arrayBuffers": 24947 + }, + "after": { + "rss": 417153024, + "heapTotal": 234487808, + "heapUsed": 88478944, + "external": 2547294, + "arrayBuffers": 237939 + }, + "retained": { + "rss": 417218560, + "heapTotal": 201457664, + "heapUsed": 23810968, + "external": 2544727, + "arrayBuffers": 24947 + }, + "outputBytes": 1681176, + "outputMapBytes": 6961704, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:08.074Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 294.84847090000005, + "minMsPerCorpus": 294.84847090000005, + "maxMsPerCorpus": 294.84847090000005, + "medianPeakRssMiB": 397.046875, + "medianRetainedHeapMiB": 22.711685180664062, + "medianWallMs": 3810.796667, + "phasesMsPerCorpus": { + "detectGroupings": 24.605311700000357, + "sharedAnalysis": 20.32738700000068, + "referenceCompile": 104.84399169999884, + "virtualCompile": 136.3908109999969, + "sharedCompile": 7.355774799999563 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 3810.796667, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 2948.4847090000003, + "phases": { + "detectGroupings": 246.05311700000357, + "sharedAnalysis": 203.2738700000068, + "referenceCompile": 1048.4399169999883, + "virtualCompile": 1363.908109999969, + "sharedCompile": 73.55774799999563 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 406576, + "before": { + "rss": 301891584, + "heapTotal": 191889408, + "heapUsed": 22841544, + "external": 3274330, + "arrayBuffers": 24947 + }, + "after": { + "rss": 416088064, + "heapTotal": 239206400, + "heapUsed": 96051024, + "external": 2728202, + "arrayBuffers": 418847 + }, + "retained": { + "rss": 416333824, + "heapTotal": 201195520, + "heapUsed": 23814928, + "external": 2725635, + "arrayBuffers": 24947 + }, + "outputBytes": 1681176, + "outputMapBytes": 6961704, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:20.952Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 295.3870167, + "minMsPerCorpus": 295.3870167, + "maxMsPerCorpus": 295.3870167, + "medianPeakRssMiB": 396.640625, + "medianRetainedHeapMiB": 22.710411071777344, + "medianWallMs": 3795.948667, + "phasesMsPerCorpus": { + "detectGroupings": 26.223525199999493, + "sharedAnalysis": 20.071665999999958, + "referenceCompile": 104.33288180000041, + "virtualCompile": 137.15617620000162, + "sharedCompile": 6.25969519999976 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 3795.948667, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 2953.870167, + "phases": { + "detectGroupings": 262.23525199999494, + "sharedAnalysis": 200.7166599999996, + "referenceCompile": 1043.328818000004, + "virtualCompile": 1371.5617620000162, + "sharedCompile": 62.5969519999976 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 406160, + "before": { + "rss": 303185920, + "heapTotal": 188219392, + "heapUsed": 21807312, + "external": 3175678, + "arrayBuffers": 24947 + }, + "after": { + "rss": 415858688, + "heapTotal": 236847104, + "heapUsed": 86736440, + "external": 2481758, + "arrayBuffers": 172403 + }, + "retained": { + "rss": 415907840, + "heapTotal": 200146944, + "heapUsed": 23813592, + "external": 2479191, + "arrayBuffers": 24947 + }, + "outputBytes": 1681176, + "outputMapBytes": 6961704, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:31.159Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 295.7061917, + "minMsPerCorpus": 295.7061917, + "maxMsPerCorpus": 295.7061917, + "medianPeakRssMiB": 397.25, + "medianRetainedHeapMiB": 22.738487243652344, + "medianWallMs": 3804.7319159999997, + "phasesMsPerCorpus": { + "detectGroupings": 31.23931400000015, + "sharedAnalysis": 19.84409530000057, + "referenceCompile": 105.49114710000053, + "virtualCompile": 131.51864249999934, + "sharedCompile": 6.276195600000347 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 3804.7319159999997, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 2957.061917, + "phases": { + "detectGroupings": 312.3931400000015, + "sharedAnalysis": 198.44095300000572, + "referenceCompile": 1054.9114710000053, + "virtualCompile": 1315.1864249999935, + "sharedCompile": 62.761956000003465 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 406784, + "before": { + "rss": 302284800, + "heapTotal": 190054400, + "heapUsed": 22841240, + "external": 3307098, + "arrayBuffers": 24947 + }, + "after": { + "rss": 416268288, + "heapTotal": 238682112, + "heapUsed": 100261696, + "external": 2745618, + "arrayBuffers": 436263 + }, + "retained": { + "rss": 416251904, + "heapTotal": 202506240, + "heapUsed": 23843032, + "external": 2743051, + "arrayBuffers": 24947 + }, + "outputBytes": 1681176, + "outputMapBytes": 6961704, + "resolvedReferences": 0 + } + ] + } + ], + "candidate": [ + { + "timestamp": "2026-09-26T14:35:45.941Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 88.14785830000001, + "minMsPerCorpus": 88.14785830000001, + "maxMsPerCorpus": 88.14785830000001, + "medianPeakRssMiB": 260.53125, + "medianRetainedHeapMiB": 8.174758911132812, + "medianWallMs": 1153.860959, + "phasesMsPerCorpus": { + "parseAnalyze": 9.36212299999993, + "detectGroupings": 0.0626276999998936, + "sharedAnalysis": 1.5495984999995926, + "referenceCompile": 25.020658200000277, + "virtualCompile": 48.41749239999988, + "sharedCompile": 2.7493755000000872 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1153.860959, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 881.4785830000001, + "phases": { + "parseAnalyze": 93.62122999999929, + "detectGroupings": 0.6262769999989359, + "sharedAnalysis": 15.495984999995926, + "referenceCompile": 250.20658200000275, + "virtualCompile": 484.1749239999988, + "sharedCompile": 27.493755000000874 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 266784, + "before": { + "rss": 106561536, + "heapTotal": 46497792, + "heapUsed": 8403992, + "external": 5248469, + "arrayBuffers": 342851 + }, + "after": { + "rss": 273055744, + "heapTotal": 160530432, + "heapUsed": 42673360, + "external": 11001034, + "arrayBuffers": 8710294 + }, + "retained": { + "rss": 273186816, + "heapTotal": 155287552, + "heapUsed": 8571856, + "external": 11001034, + "arrayBuffers": 8343114 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:35:53.847Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 88.6960542, + "minMsPerCorpus": 88.6960542, + "maxMsPerCorpus": 88.6960542, + "medianPeakRssMiB": 196.984375, + "medianRetainedHeapMiB": 8.178550720214844, + "medianWallMs": 1166.239792, + "phasesMsPerCorpus": { + "parseAnalyze": 9.393192600000043, + "detectGroupings": 0.06513959999972485, + "sharedAnalysis": 1.5678345000001854, + "referenceCompile": 25.098951599999715, + "virtualCompile": 48.6562419000001, + "sharedCompile": 2.9179158999999344 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1166.239792, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 886.960542, + "phases": { + "parseAnalyze": 93.93192600000043, + "detectGroupings": 0.6513959999972485, + "sharedAnalysis": 15.678345000001855, + "referenceCompile": 250.98951599999714, + "virtualCompile": 486.562419000001, + "sharedCompile": 29.179158999999345 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 201712, + "before": { + "rss": 111116288, + "heapTotal": 46235648, + "heapUsed": 8482328, + "external": 3845737, + "arrayBuffers": 29075 + }, + "after": { + "rss": 206487552, + "heapTotal": 164986880, + "heapUsed": 31551656, + "external": 8915677, + "arrayBuffers": 6624937 + }, + "retained": { + "rss": 206028800, + "heapTotal": 156073984, + "heapUsed": 8575832, + "external": 8915677, + "arrayBuffers": 6124697 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:09.306Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 90.3783833, + "minMsPerCorpus": 90.3783833, + "maxMsPerCorpus": 90.3783833, + "medianPeakRssMiB": 197.546875, + "medianRetainedHeapMiB": 8.179878234863281, + "medianWallMs": 1184.489667, + "phasesMsPerCorpus": { + "parseAnalyze": 9.93402249999981, + "detectGroupings": 0.06458370000011655, + "sharedAnalysis": 1.6494046999999, + "referenceCompile": 25.302154700000006, + "virtualCompile": 49.397937699999694, + "sharedCompile": 2.917796400000134 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1184.489667, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 903.783833, + "phases": { + "parseAnalyze": 99.3402249999981, + "detectGroupings": 0.6458370000011655, + "sharedAnalysis": 16.494046999999, + "referenceCompile": 253.02154700000006, + "virtualCompile": 493.97937699999693, + "sharedCompile": 29.17796400000134 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 202288, + "before": { + "rss": 110280704, + "heapTotal": 45973504, + "heapUsed": 8484664, + "external": 3879497, + "arrayBuffers": 213971 + }, + "after": { + "rss": 206979072, + "heapTotal": 164724736, + "heapUsed": 32626832, + "external": 9172695, + "arrayBuffers": 6881955 + }, + "retained": { + "rss": 206635008, + "heapTotal": 156336128, + "heapUsed": 8577224, + "external": 9172695, + "arrayBuffers": 6036433 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:17.107Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 89.73758330000001, + "minMsPerCorpus": 89.73758330000001, + "maxMsPerCorpus": 89.73758330000001, + "medianPeakRssMiB": 200.65625, + "medianRetainedHeapMiB": 8.180679321289062, + "medianWallMs": 1173.154083, + "phasesMsPerCorpus": { + "parseAnalyze": 9.647624400000018, + "detectGroupings": 0.06588820000015402, + "sharedAnalysis": 1.629834700000174, + "referenceCompile": 25.650460599999974, + "virtualCompile": 48.9059964999999, + "sharedCompile": 2.809421800000041 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1173.154083, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 897.3758330000001, + "phases": { + "parseAnalyze": 96.47624400000018, + "detectGroupings": 0.6588820000015403, + "sharedAnalysis": 16.29834700000174, + "referenceCompile": 256.50460599999974, + "virtualCompile": 489.059964999999, + "sharedCompile": 28.09421800000041 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 205472, + "before": { + "rss": 111493120, + "heapTotal": 45973504, + "heapUsed": 8482040, + "external": 3967635, + "arrayBuffers": 101127 + }, + "after": { + "rss": 210386944, + "heapTotal": 163414016, + "heapUsed": 64488848, + "external": 16403517, + "arrayBuffers": 14112777 + }, + "retained": { + "rss": 209485824, + "heapTotal": 155549696, + "heapUsed": 8578064, + "external": 16403517, + "arrayBuffers": 13822749 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:32.364Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 88.1096417, + "minMsPerCorpus": 88.1096417, + "maxMsPerCorpus": 88.1096417, + "medianPeakRssMiB": 260.296875, + "medianRetainedHeapMiB": 8.173538208007812, + "medianWallMs": 1156.9088749999999, + "phasesMsPerCorpus": { + "parseAnalyze": 9.130140199999891, + "detectGroupings": 0.06253070000034314, + "sharedAnalysis": 1.4943275000002358, + "referenceCompile": 25.17858310000006, + "virtualCompile": 48.38254080000022, + "sharedCompile": 2.874737500000015 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1156.9088749999999, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 881.096417, + "phases": { + "parseAnalyze": 91.30140199999892, + "detectGroupings": 0.6253070000034313, + "sharedAnalysis": 14.943275000002359, + "referenceCompile": 251.7858310000006, + "virtualCompile": 483.8254080000022, + "sharedCompile": 28.747375000000147 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 266544, + "before": { + "rss": 102924288, + "heapTotal": 46235648, + "heapUsed": 8482448, + "external": 4099902, + "arrayBuffers": 297351 + }, + "after": { + "rss": 272809984, + "heapTotal": 160268288, + "heapUsed": 43852336, + "external": 11276107, + "arrayBuffers": 8985367 + }, + "retained": { + "rss": 272826368, + "heapTotal": 154763264, + "heapUsed": 8570576, + "external": 11276107, + "arrayBuffers": 8551579 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] + } + ] + }, + "routes": { + "baseline": [ + { + "timestamp": "2026-09-26T14:35:48.225Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1871.0768329999999, + "medianPeakRssMiB": 747.578125, + "medianWallMs": 2238.094333 + }, + "samples": [ + { + "buildMs": 1871.0768329999999, + "peakRssMiB": 747.578125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 145162240, + "heapTotal": 105725952, + "heapUsed": 29409128, + "external": 4398576, + "arrayBuffers": 44463 + }, + "after": { + "rss": 783351808, + "heapTotal": 319356928, + "heapUsed": 197274840, + "external": 5754238, + "arrayBuffers": 166917 + }, + "retained": { + "rss": 765542400, + "heapTotal": 274972672, + "heapUsed": 56549856, + "external": 5737854, + "arrayBuffers": 68613 + }, + "wallMs": 2238.094333 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:01.331Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1808.7438750000001, + "medianPeakRssMiB": 744.375, + "medianWallMs": 2185.8342079999998 + }, + "samples": [ + { + "buildMs": 1808.7438750000001, + "peakRssMiB": 744.375, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 147324928, + "heapTotal": 105463808, + "heapUsed": 29409128, + "external": 4398576, + "arrayBuffers": 44463 + }, + "after": { + "rss": 775258112, + "heapTotal": 299548672, + "heapUsed": 142663080, + "external": 5655934, + "arrayBuffers": 68613 + }, + "retained": { + "rss": 761577472, + "heapTotal": 249020416, + "heapUsed": 56549512, + "external": 5639550, + "arrayBuffers": 68613 + }, + "wallMs": 2185.8342079999998 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:11.527Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1807.0996249999998, + "medianPeakRssMiB": 732.90625, + "medianWallMs": 2170.065708 + }, + "samples": [ + { + "buildMs": 1807.0996249999998, + "peakRssMiB": 732.90625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 141115392, + "heapTotal": 65617920, + "heapUsed": 29433424, + "external": 4202328, + "arrayBuffers": 44463 + }, + "after": { + "rss": 763265024, + "heapTotal": 288014336, + "heapUsed": 142205968, + "external": 5655934, + "arrayBuffers": 68613 + }, + "retained": { + "rss": 750239744, + "heapTotal": 249806848, + "heapUsed": 56559568, + "external": 5639550, + "arrayBuffers": 68613 + }, + "wallMs": 2170.065708 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:24.442Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1720.8670000000002, + "medianPeakRssMiB": 682.6875, + "medianWallMs": 2074.105834 + }, + "samples": [ + { + "buildMs": 1720.8670000000002, + "peakRssMiB": 682.6875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 141213696, + "heapTotal": 72171520, + "heapUsed": 29409184, + "external": 4398576, + "arrayBuffers": 44463 + }, + "after": { + "rss": 709705728, + "heapTotal": 293896192, + "heapUsed": 133813728, + "external": 5655934, + "arrayBuffers": 68613 + }, + "retained": { + "rss": 695975936, + "heapTotal": 237223936, + "heapUsed": 54451848, + "external": 5639550, + "arrayBuffers": 68613 + }, + "wallMs": 2074.105834 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:34.510Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1740.4357919999998, + "medianPeakRssMiB": 709.265625, + "medianWallMs": 2098.6092080000003 + }, + "samples": [ + { + "buildMs": 1740.4357919999998, + "peakRssMiB": 709.265625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 142573568, + "heapTotal": 72433664, + "heapUsed": 29409264, + "external": 4398576, + "arrayBuffers": 44463 + }, + "after": { + "rss": 725647360, + "heapTotal": 293847040, + "heapUsed": 66674384, + "external": 5737854, + "arrayBuffers": 68613 + }, + "retained": { + "rss": 725778432, + "heapTotal": 193183744, + "heapUsed": 54438744, + "external": 5639550, + "arrayBuffers": 68613 + }, + "wallMs": 2098.6092080000003 + } + ] + } + ], + "candidate": [ + { + "timestamp": "2026-09-26T14:35:49.607Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1054.6917919999999, + "medianPeakRssMiB": 647.828125, + "medianWallMs": 1330.3524169999998 + }, + "samples": [ + { + "buildMs": 1054.6917919999999, + "peakRssMiB": 647.828125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 122093568, + "heapTotal": 59326464, + "heapUsed": 22895328, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 658210816, + "heapTotal": 244531200, + "heapUsed": 54191848, + "external": 15046578, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 657260544, + "heapTotal": 179257344, + "heapUsed": 42096120, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1330.3524169999998 + } + ] + }, + { + "timestamp": "2026-09-26T14:35:59.091Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1074.3969579999998, + "medianPeakRssMiB": 650.328125, + "medianWallMs": 1350.225625 + }, + "samples": [ + { + "buildMs": 1074.3969579999998, + "peakRssMiB": 650.328125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 122699776, + "heapTotal": 59064320, + "heapUsed": 22896552, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 660848640, + "heapTotal": 243220480, + "heapUsed": 54184368, + "external": 15046778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 660176896, + "heapTotal": 179257344, + "heapUsed": 42080760, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1350.225625 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:12.899Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1043.905375, + "medianPeakRssMiB": 643.765625, + "medianWallMs": 1321.924917 + }, + "samples": [ + { + "buildMs": 1043.905375, + "peakRssMiB": 643.765625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 122044416, + "heapTotal": 59064320, + "heapUsed": 22894648, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 653803520, + "heapTotal": 247414784, + "heapUsed": 54181128, + "external": 15046778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 653246464, + "heapTotal": 178995200, + "heapUsed": 42088736, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1321.924917 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:22.318Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1048.237334, + "medianPeakRssMiB": 642.203125, + "medianWallMs": 1318.853583 + }, + "samples": [ + { + "buildMs": 1048.237334, + "peakRssMiB": 642.203125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 122060800, + "heapTotal": 59326464, + "heapUsed": 22895920, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 652345344, + "heapTotal": 239812608, + "heapUsed": 54174824, + "external": 15046778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 651493376, + "heapTotal": 178733056, + "heapUsed": 42080752, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1318.853583 + } + ] + }, + { + "timestamp": "2026-09-26T14:36:35.944Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "summary": { + "medianBuildMs": 1104.890167, + "medianPeakRssMiB": 648.609375, + "medianWallMs": 1384.6932909999998 + }, + "samples": [ + { + "buildMs": 1104.890167, + "peakRssMiB": 648.609375, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 124567552, + "heapTotal": 59326464, + "heapUsed": 22895456, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 658997248, + "heapTotal": 241385472, + "heapUsed": 54859264, + "external": 15046778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 649805824, + "heapTotal": 180043776, + "heapUsed": 42076992, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1384.6932909999998 + } + ] + } + ] + }, + "start": { + "baseline": [ + { + "timestamp": "2026-09-26T14:35:51.386Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1571.32025, + "minBuildMs": 1571.32025, + "maxBuildMs": 1571.32025, + "medianWallMs": 1729.887292, + "medianPeakRssMiB": 706.453125 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1729.887292, + "buildMs": 1571.32025, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 723408, + "before": { + "rss": 88719360, + "heapTotal": 24887296, + "heapUsed": 14195112, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 735002624, + "heapTotal": 410386432, + "heapUsed": 292805816, + "external": 6772977, + "arrayBuffers": 379264 + }, + "retained": { + "rss": 733020160, + "heapTotal": 370606080, + "heapUsed": 137805208, + "external": 6772977, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:04.212Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1489.416959, + "minBuildMs": 1489.416959, + "maxBuildMs": 1489.416959, + "medianWallMs": 1643.3514590000002, + "medianPeakRssMiB": 657.625 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1643.3514590000002, + "buildMs": 1489.416959, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 673408, + "before": { + "rss": 88702976, + "heapTotal": 24625152, + "heapUsed": 14195352, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 684785664, + "heapTotal": 363708416, + "heapUsed": 269806768, + "external": 6894065, + "arrayBuffers": 474882 + }, + "retained": { + "rss": 684195840, + "heapTotal": 342818816, + "heapUsed": 135682448, + "external": 6894065, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:14.665Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1559.0893330000001, + "minBuildMs": 1559.0893330000001, + "maxBuildMs": 1559.0893330000001, + "medianWallMs": 1715.968, + "medianPeakRssMiB": 685.8125 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1715.968, + "buildMs": 1559.0893330000001, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 702272, + "before": { + "rss": 88915968, + "heapTotal": 24100864, + "heapUsed": 14195136, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 712835072, + "heapTotal": 393330688, + "heapUsed": 286059152, + "external": 6749420, + "arrayBuffers": 330237 + }, + "retained": { + "rss": 713949184, + "heapTotal": 364838912, + "heapUsed": 135694048, + "external": 6749420, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:27.304Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1467.7916659999999, + "minBuildMs": 1467.7916659999999, + "maxBuildMs": 1467.7916659999999, + "medianWallMs": 1623.308959, + "medianPeakRssMiB": 658.265625 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1623.308959, + "buildMs": 1467.7916659999999, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 674064, + "before": { + "rss": 88883200, + "heapTotal": 24100864, + "heapUsed": 14195312, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 685359104, + "heapTotal": 364232704, + "heapUsed": 271037792, + "external": 6910449, + "arrayBuffers": 491266 + }, + "retained": { + "rss": 684900352, + "heapTotal": 338886656, + "heapUsed": 135673848, + "external": 6910449, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:37.687Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1530.598542, + "minBuildMs": 1530.598542, + "maxBuildMs": 1530.598542, + "medianWallMs": 1689.014917, + "medianPeakRssMiB": 658.671875 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1689.014917, + "buildMs": 1530.598542, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 674480, + "before": { + "rss": 88948736, + "heapTotal": 25149440, + "heapUsed": 14195480, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 685735936, + "heapTotal": 363184128, + "heapUsed": 269252696, + "external": 6894065, + "arrayBuffers": 474882 + }, + "retained": { + "rss": 685375488, + "heapTotal": 340459520, + "heapUsed": 135661296, + "external": 6894065, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } + ] + } + ], + "candidate": [ + { + "timestamp": "2026-09-26T14:35:52.632Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1063.265167, + "minBuildMs": 1063.265167, + "maxBuildMs": 1063.265167, + "medianWallMs": 1191.9837089999999, + "medianPeakRssMiB": 545.578125 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1191.9837089999999, + "buildMs": 1063.265167, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 558672, + "before": { + "rss": 89292800, + "heapTotal": 25411584, + "heapUsed": 14190608, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 571834368, + "heapTotal": 230998016, + "heapUsed": 111511496, + "external": 13343941, + "arrayBuffers": 6924758 + }, + "retained": { + "rss": 569294848, + "heapTotal": 218103808, + "heapUsed": 57000904, + "external": 13343941, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:02.521Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1013.4215829999999, + "minBuildMs": 1013.4215829999999, + "maxBuildMs": 1013.4215829999999, + "medianWallMs": 1140.718417, + "medianPeakRssMiB": 535.109375 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1140.718417, + "buildMs": 1013.4215829999999, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 547952, + "before": { + "rss": 88834048, + "heapTotal": 24887296, + "heapUsed": 14190608, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 560283648, + "heapTotal": 214204416, + "heapUsed": 115507256, + "external": 13742731, + "arrayBuffers": 7323548 + }, + "retained": { + "rss": 557137920, + "heapTotal": 208666624, + "heapUsed": 57070344, + "external": 13742731, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:15.883Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1038.3464589999999, + "minBuildMs": 1038.3464589999999, + "maxBuildMs": 1038.3464589999999, + "medianWallMs": 1170.7812920000001, + "medianPeakRssMiB": 562.890625 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1170.7812920000001, + "buildMs": 1038.3464589999999, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 576400, + "before": { + "rss": 90128384, + "heapTotal": 25149440, + "heapUsed": 14190616, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 589856768, + "heapTotal": 241238016, + "heapUsed": 150320736, + "external": 18296840, + "arrayBuffers": 11877657 + }, + "retained": { + "rss": 582205440, + "heapTotal": 229376000, + "heapUsed": 57109944, + "external": 18296840, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:25.633Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1013.89025, + "minBuildMs": 1013.89025, + "maxBuildMs": 1013.89025, + "medianWallMs": 1141.1762919999999, + "medianPeakRssMiB": 522.984375 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1141.1762919999999, + "buildMs": 1013.89025, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 535536, + "before": { + "rss": 89063424, + "heapTotal": 25149440, + "heapUsed": 14190544, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 547962880, + "heapTotal": 223707136, + "heapUsed": 79340024, + "external": 14290752, + "arrayBuffers": 3039024 + }, + "retained": { + "rss": 545505280, + "heapTotal": 202113024, + "heapUsed": 56986840, + "external": 9419845, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } + ] + }, + { + "timestamp": "2026-09-26T14:36:38.944Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "app": "e2e/react-start/server-functions", + "repetitions": 1, + "profile": false, + "summary": { + "medianBuildMs": 1074.08075, + "minBuildMs": 1074.08075, + "maxBuildMs": 1074.08075, + "medianWallMs": 1209.1439169999999, + "medianPeakRssMiB": 570.140625 + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1209.1439169999999, + "buildMs": 1074.08075, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 583824, + "before": { + "rss": 89047040, + "heapTotal": 25149440, + "heapUsed": 14192072, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 597508096, + "heapTotal": 241139712, + "heapUsed": 131970136, + "external": 16703009, + "arrayBuffers": 10283826 + }, + "retained": { + "rss": 592838656, + "heapTotal": 233046016, + "heapUsed": 57097488, + "external": 16703009, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } + ] + } + ] + } + } +} diff --git a/benchmarks/compiler/results/final-bindings-1000-baseline.json b/benchmarks/compiler/results/final-bindings-1000-baseline.json new file mode 100644 index 00000000000..430dc2c5772 --- /dev/null +++ b/benchmarks/compiler/results/final-bindings-1000-baseline.json @@ -0,0 +1,197 @@ +{ + "timestamp": "2026-09-26T14:40:51.634Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 3, + "iterations": 2, + "diagnosticOnly": false, + "warmups": 1, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 3793.8502915, + "minMsPerCorpus": 3760.634271, + "maxMsPerCorpus": 3828.5876670000002, + "medianPeakRssMiB": 354.875, + "medianRetainedHeapMiB": 17.968788146972656, + "medianWallMs": 11546.288959, + "phasesMsPerCorpus": { + "detectGroupings": 32.252519999999095, + "sharedAnalysis": 2267.889271000001, + "referenceCompile": 124.28177049999977, + "virtualCompile": 217.13372849999814, + "sharedCompile": 1153.7283749999997 + }, + "countsPerCorpus": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 11546.288959, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 7587.700583, + "phases": { + "detectGroupings": 63.87962400000106, + "sharedAnalysis": 4535.778542000002, + "referenceCompile": 248.56354099999953, + "virtualCompile": 430.7125849999993, + "sharedCompile": 2307.4567499999994 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 363168, + "before": { + "rss": 295305216, + "heapTotal": 186761216, + "heapUsed": 17369160, + "external": 2380706, + "arrayBuffers": 24947 + }, + "after": { + "rss": 371245056, + "heapTotal": 266190848, + "heapUsed": 171501216, + "external": 2350686, + "arrayBuffers": 41331 + }, + "retained": { + "rss": 370999296, + "heapTotal": 218480640, + "heapUsed": 18839112, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 620817, + "outputMapBytes": 2256354, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 11513.104541, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 7521.268542, + "phases": { + "detectGroupings": 64.50503999999819, + "sharedAnalysis": 4481.174709000001, + "referenceCompile": 246.53579200000058, + "virtualCompile": 434.2674569999963, + "sharedCompile": 2293.4136659999986 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 363392, + "before": { + "rss": 296550400, + "heapTotal": 187547648, + "heapUsed": 17371496, + "external": 2380706, + "arrayBuffers": 24947 + }, + "after": { + "rss": 371916800, + "heapTotal": 266190848, + "heapUsed": 171614384, + "external": 2350686, + "arrayBuffers": 41331 + }, + "retained": { + "rss": 371539968, + "heapTotal": 220053504, + "heapUsed": 18841640, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 620817, + "outputMapBytes": 2256354, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 11588.479666000003, + "mode": "babel-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 7657.1753340000005, + "phases": { + "detectGroupings": 64.65754200000083, + "sharedAnalysis": 4558.472375999998, + "referenceCompile": 249.62962499999958, + "virtualCompile": 437.05979099999604, + "sharedCompile": 2345.9665000000023 + }, + "counts": { + "parses": 18, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 372576, + "before": { + "rss": 301514752, + "heapTotal": 187547648, + "heapUsed": 17392224, + "external": 2350646, + "arrayBuffers": 24947 + }, + "after": { + "rss": 381009920, + "heapTotal": 265928704, + "heapUsed": 171758184, + "external": 2350686, + "arrayBuffers": 41331 + }, + "retained": { + "rss": 380731392, + "heapTotal": 220315648, + "heapUsed": 18858208, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 620817, + "outputMapBytes": 2256354, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/final-bindings-1000-candidate.json b/benchmarks/compiler/results/final-bindings-1000-candidate.json new file mode 100644 index 00000000000..2122117dbcb --- /dev/null +++ b/benchmarks/compiler/results/final-bindings-1000-candidate.json @@ -0,0 +1,203 @@ +{ + "timestamp": "2026-09-26T14:40:55.950Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "repetitions": 3, + "iterations": 2, + "diagnosticOnly": false, + "warmups": 1, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 187.398833, + "minMsPerCorpus": 174.92145800000003, + "maxMsPerCorpus": 187.41602049999997, + "medianPeakRssMiB": 166.515625, + "medianRetainedHeapMiB": 7.570953369140625, + "medianWallMs": 649.2403340000001, + "phasesMsPerCorpus": { + "parseAnalyze": 15.395520499999975, + "detectGroupings": 0.015166500000020733, + "sharedAnalysis": 4.055208999999991, + "referenceCompile": 38.75266749999997, + "virtualCompile": 85.31450050000001, + "sharedCompile": 43.161207500000046 + }, + "countsPerCorpus": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 664.196583, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 374.797666, + "phases": { + "parseAnalyze": 31.13950100000011, + "detectGroupings": 0.030333000000041466, + "sharedAnalysis": 8.110417999999981, + "referenceCompile": 77.55683299999998, + "virtualCompile": 170.62900100000002, + "sharedCompile": 86.52324999999985 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 170512, + "before": { + "rss": 122716160, + "heapTotal": 49643520, + "heapUsed": 7664720, + "external": 6512155, + "arrayBuffers": 24819 + }, + "after": { + "rss": 171556864, + "heapTotal": 91127808, + "heapUsed": 18931776, + "external": 3670755, + "arrayBuffers": 1380015 + }, + "retained": { + "rss": 169852928, + "heapTotal": 79413248, + "heapUsed": 7938720, + "external": 3670755, + "arrayBuffers": 24819 + }, + "outputBytes": 584781, + "outputMapBytes": 1695723, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 649.2403340000001, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 374.83204099999995, + "phases": { + "parseAnalyze": 30.79104099999995, + "detectGroupings": 0.029415999999969245, + "sharedAnalysis": 8.119167000000061, + "referenceCompile": 77.50533499999995, + "virtualCompile": 171.28025000000002, + "sharedCompile": 86.32241500000009 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 166528, + "before": { + "rss": 119930880, + "heapTotal": 49905664, + "heapUsed": 7664792, + "external": 6512155, + "arrayBuffers": 24819 + }, + "after": { + "rss": 167444480, + "heapTotal": 91652096, + "heapUsed": 18931632, + "external": 3670755, + "arrayBuffers": 1380015 + }, + "retained": { + "rss": 165707776, + "heapTotal": 79675392, + "heapUsed": 7938792, + "external": 3670755, + "arrayBuffers": 24819 + }, + "outputBytes": 584781, + "outputMapBytes": 1695723, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 627.6554580000002, + "mode": "yuku-splitter", + "corpus": { + "files": 1, + "bytes": 40679, + "sha256": "6baeb549bd0040c761e12287b86d6db07b89e9933c02216aad6789401d2e3bad" + }, + "elapsedMs": 349.84291600000006, + "phases": { + "parseAnalyze": 24.425998999999933, + "detectGroupings": 0.036750999999981104, + "sharedAnalysis": 6.1574170000000095, + "referenceCompile": 77.37704099999996, + "virtualCompile": 159.68791800000008, + "sharedCompile": 81.36866699999996 + }, + "counts": { + "parses": 3, + "outputs": 12, + "sharedModules": 2 + }, + "peakRssKiB": 176368, + "before": { + "rss": 126599168, + "heapTotal": 83755008, + "heapUsed": 10417880, + "external": 6514927, + "arrayBuffers": 567923 + }, + "after": { + "rss": 180551680, + "heapTotal": 98140160, + "heapUsed": 57395704, + "external": 9700214, + "arrayBuffers": 7409474 + }, + "retained": { + "rss": 174571520, + "heapTotal": 87916544, + "heapUsed": 7886328, + "external": 9700214, + "arrayBuffers": 24819 + }, + "outputBytes": 584781, + "outputMapBytes": 1695723, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-128-profile.json b/benchmarks/compiler/results/final-cache-250-128-profile.json new file mode 100644 index 00000000000..576cb7dedc8 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-128-profile.json @@ -0,0 +1,330 @@ +{ + "timestamp": "2026-09-26T14:38:19.742Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 128, + "summary": { + "medianBuildMs": 1103.410708, + "medianPeakRssMiB": 607.3125, + "medianWallMs": 1412.646417 + }, + "samples": [ + { + "buildMs": 1103.410708, + "peakRssMiB": 607.3125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 133955584, + "heapTotal": 59588608, + "heapUsed": 23145576, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 632012800, + "heapTotal": 250363904, + "heapUsed": 129986016, + "external": 5655806, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 618545152, + "heapTotal": 203898880, + "heapUsed": 41722584, + "external": 5639422, + "arrayBuffers": 68485 + }, + "analyzerCalls": 751, + "analysesByFile": { + "routes/route-0002.tsx": 3, + "routes/route-0007.tsx": 3, + "routes/__root.tsx": 1, + "routes/route-0003.tsx": 3, + "routes/route-0005.tsx": 3, + "routes/route-0006.tsx": 3, + "routes/route-0004.tsx": 3, + "routes/route-0032.tsx": 3, + "routes/route-0000.tsx": 3, + "routes/route-0046.tsx": 3, + "routes/route-0033.tsx": 3, + "routes/route-0001.tsx": 3, + "routes/route-0040.tsx": 3, + "routes/route-0025.tsx": 3, + "routes/route-0041.tsx": 3, + "routes/route-0013.tsx": 3, + "routes/route-0042.tsx": 3, + "routes/route-0008.tsx": 3, + "routes/route-0019.tsx": 3, + "routes/route-0020.tsx": 3, + "routes/route-0014.tsx": 3, + "routes/route-0039.tsx": 3, + "routes/route-0031.tsx": 3, + "routes/route-0043.tsx": 3, + "routes/route-0009.tsx": 3, + "routes/route-0021.tsx": 3, + "routes/route-0034.tsx": 3, + "routes/route-0010.tsx": 3, + "routes/route-0044.tsx": 3, + "routes/route-0022.tsx": 3, + "routes/route-0023.tsx": 3, + "routes/route-0035.tsx": 3, + "routes/route-0045.tsx": 3, + "routes/route-0016.tsx": 3, + "routes/route-0084.tsx": 3, + "routes/route-0024.tsx": 3, + "routes/route-0015.tsx": 3, + "routes/route-0011.tsx": 3, + "routes/route-0028.tsx": 3, + "routes/route-0012.tsx": 3, + "routes/route-0047.tsx": 3, + "routes/route-0027.tsx": 3, + "routes/route-0036.tsx": 3, + "routes/route-0048.tsx": 3, + "routes/route-0030.tsx": 3, + "routes/route-0026.tsx": 3, + "routes/route-0018.tsx": 3, + "routes/route-0037.tsx": 3, + "routes/route-0049.tsx": 3, + "routes/route-0038.tsx": 3, + "routes/route-0061.tsx": 3, + "routes/route-0075.tsx": 3, + "routes/route-0076.tsx": 3, + "routes/route-0058.tsx": 3, + "routes/route-0057.tsx": 3, + "routes/route-0066.tsx": 3, + "routes/route-0067.tsx": 3, + "routes/route-0077.tsx": 3, + "routes/route-0068.tsx": 3, + "routes/route-0059.tsx": 3, + "routes/route-0050.tsx": 3, + "routes/route-0078.tsx": 3, + "routes/route-0060.tsx": 3, + "routes/route-0069.tsx": 3, + "routes/route-0062.tsx": 3, + "routes/route-0051.tsx": 3, + "routes/route-0079.tsx": 3, + "routes/route-0070.tsx": 3, + "routes/route-0063.tsx": 3, + "routes/route-0052.tsx": 3, + "routes/route-0080.tsx": 3, + "routes/route-0017.tsx": 3, + "routes/route-0071.tsx": 3, + "routes/route-0083.tsx": 3, + "routes/route-0082.tsx": 3, + "routes/route-0072.tsx": 3, + "routes/route-0053.tsx": 3, + "routes/route-0138.tsx": 3, + "routes/route-0065.tsx": 3, + "routes/route-0054.tsx": 3, + "routes/route-0112.tsx": 3, + "routes/route-0064.tsx": 3, + "routes/route-0029.tsx": 3, + "routes/route-0081.tsx": 3, + "routes/route-0113.tsx": 3, + "routes/route-0111.tsx": 3, + "routes/route-0114.tsx": 3, + "routes/route-0104.tsx": 3, + "routes/route-0115.tsx": 3, + "routes/route-0090.tsx": 3, + "routes/route-0098.tsx": 3, + "routes/route-0097.tsx": 3, + "routes/route-0165.tsx": 3, + "routes/route-0091.tsx": 3, + "routes/route-0116.tsx": 3, + "routes/route-0105.tsx": 3, + "routes/route-0139.tsx": 3, + "routes/route-0099.tsx": 3, + "routes/route-0106.tsx": 3, + "routes/route-0085.tsx": 3, + "routes/route-0092.tsx": 3, + "routes/route-0086.tsx": 3, + "routes/route-0100.tsx": 3, + "routes/route-0093.tsx": 3, + "routes/route-0101.tsx": 3, + "routes/route-0087.tsx": 3, + "routes/route-0107.tsx": 3, + "routes/route-0055.tsx": 3, + "routes/route-0102.tsx": 3, + "routes/route-0103.tsx": 3, + "routes/route-0056.tsx": 3, + "routes/route-0108.tsx": 3, + "routes/route-0117.tsx": 3, + "routes/route-0096.tsx": 3, + "routes/route-0095.tsx": 3, + "routes/route-0118.tsx": 3, + "routes/route-0089.tsx": 3, + "routes/route-0109.tsx": 3, + "routes/route-0249.tsx": 3, + "routes/route-0110.tsx": 3, + "routes/route-0119.tsx": 3, + "routes/route-0207.tsx": 3, + "routes/route-0208.tsx": 3, + "routes/route-0166.tsx": 3, + "routes/route-0129.tsx": 3, + "routes/route-0128.tsx": 3, + "routes/route-0209.tsx": 3, + "routes/route-0167.tsx": 3, + "routes/route-0210.tsx": 3, + "routes/route-0124.tsx": 3, + "routes/route-0188.tsx": 3, + "routes/route-0140.tsx": 3, + "routes/route-0094.tsx": 3, + "routes/route-0136.tsx": 3, + "routes/route-0187.tsx": 3, + "routes/route-0211.tsx": 3, + "routes/route-0141.tsx": 3, + "routes/route-0189.tsx": 3, + "routes/route-0125.tsx": 3, + "routes/route-0142.tsx": 3, + "routes/route-0168.tsx": 3, + "routes/route-0212.tsx": 3, + "routes/route-0135.tsx": 3, + "routes/route-0190.tsx": 3, + "routes/route-0231.tsx": 3, + "routes/route-0143.tsx": 3, + "routes/route-0230.tsx": 3, + "routes/route-0126.tsx": 3, + "routes/route-0144.tsx": 3, + "routes/route-0127.tsx": 3, + "routes/route-0073.tsx": 3, + "routes/route-0191.tsx": 3, + "routes/route-0213.tsx": 3, + "routes/route-0145.tsx": 3, + "routes/route-0232.tsx": 3, + "routes/route-0074.tsx": 3, + "routes/route-0221.tsx": 3, + "routes/route-0192.tsx": 3, + "routes/route-0222.tsx": 3, + "routes/route-0146.tsx": 3, + "routes/route-0088.tsx": 3, + "routes/route-0123.tsx": 3, + "routes/route-0133.tsx": 3, + "routes/route-0223.tsx": 3, + "routes/route-0218.tsx": 3, + "routes/route-0214.tsx": 3, + "routes/route-0134.tsx": 3, + "routes/route-0120.tsx": 3, + "routes/route-0130.tsx": 3, + "routes/route-0121.tsx": 3, + "routes/route-0224.tsx": 3, + "routes/route-0169.tsx": 3, + "routes/route-0137.tsx": 3, + "routes/route-0220.tsx": 3, + "routes/route-0131.tsx": 3, + "routes/route-0228.tsx": 3, + "routes/route-0227.tsx": 3, + "routes/route-0229.tsx": 3, + "routes/route-0170.tsx": 3, + "routes/route-0156.tsx": 3, + "routes/route-0132.tsx": 3, + "routes/route-0225.tsx": 3, + "routes/route-0226.tsx": 3, + "routes/route-0171.tsx": 3, + "routes/route-0148.tsx": 3, + "routes/route-0200.tsx": 3, + "routes/route-0203.tsx": 3, + "routes/route-0149.tsx": 3, + "routes/route-0202.tsx": 3, + "routes/route-0172.tsx": 3, + "routes/route-0233.tsx": 3, + "routes/route-0217.tsx": 3, + "routes/route-0193.tsx": 3, + "routes/route-0150.tsx": 3, + "routes/route-0173.tsx": 3, + "routes/route-0194.tsx": 3, + "routes/route-0242.tsx": 3, + "routes/route-0237.tsx": 3, + "routes/route-0206.tsx": 3, + "routes/route-0122.tsx": 3, + "routes/route-0174.tsx": 3, + "routes/route-0151.tsx": 3, + "routes/route-0243.tsx": 3, + "routes/route-0153.tsx": 3, + "routes/route-0234.tsx": 3, + "routes/route-0175.tsx": 3, + "routes/route-0195.tsx": 3, + "routes/route-0154.tsx": 3, + "routes/route-0147.tsx": 3, + "routes/route-0235.tsx": 3, + "routes/route-0152.tsx": 3, + "routes/route-0155.tsx": 3, + "routes/route-0219.tsx": 3, + "routes/route-0236.tsx": 3, + "routes/route-0196.tsx": 3, + "routes/route-0204.tsx": 3, + "routes/route-0181.tsx": 3, + "routes/route-0198.tsx": 3, + "routes/route-0157.tsx": 3, + "routes/route-0240.tsx": 3, + "routes/route-0184.tsx": 3, + "routes/route-0199.tsx": 3, + "routes/route-0177.tsx": 3, + "routes/route-0158.tsx": 3, + "routes/route-0197.tsx": 3, + "routes/route-0183.tsx": 3, + "routes/route-0182.tsx": 3, + "routes/route-0185.tsx": 3, + "routes/route-0159.tsx": 3, + "routes/route-0238.tsx": 3, + "routes/route-0178.tsx": 3, + "routes/route-0246.tsx": 3, + "routes/route-0216.tsx": 3, + "routes/route-0186.tsx": 3, + "routes/route-0245.tsx": 3, + "routes/route-0179.tsx": 3, + "routes/route-0161.tsx": 3, + "routes/route-0180.tsx": 3, + "routes/route-0205.tsx": 3, + "routes/route-0164.tsx": 3, + "routes/route-0241.tsx": 3, + "routes/route-0201.tsx": 3, + "routes/route-0162.tsx": 3, + "routes/route-0160.tsx": 3, + "routes/route-0163.tsx": 3, + "routes/route-0247.tsx": 3, + "routes/route-0215.tsx": 3, + "routes/route-0244.tsx": 3, + "routes/route-0239.tsx": 3, + "routes/route-0248.tsx": 3, + "routes/route-0176.tsx": 3 + }, + "liveCache": { + "entries": 128, + "beforeClear": { + "rss": 491536384, + "heapTotal": 209928192, + "heapUsed": 43249056, + "external": 14564130, + "arrayBuffers": 2183789 + }, + "afterClear": { + "rss": 491077632, + "heapTotal": 179257344, + "heapUsed": 35578944, + "external": 5537022, + "arrayBuffers": 858293 + } + }, + "wallMs": 1412.646417 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-128-timing.json b/benchmarks/compiler/results/final-cache-250-128-timing.json new file mode 100644 index 00000000000..b4382dbdf3f --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-128-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:38:24.054Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 128, + "summary": { + "medianBuildMs": 1109.4135419999998, + "medianPeakRssMiB": 658.078125, + "medianWallMs": 1418.826333 + }, + "samples": [ + { + "buildMs": 1111.281958, + "peakRssMiB": 662, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 133152768, + "heapTotal": 59064320, + "heapUsed": 23141416, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 673071104, + "heapTotal": 242696192, + "heapUsed": 54471656, + "external": 15046778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 671612928, + "heapTotal": 178208768, + "heapUsed": 42325680, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1412.329375 + }, + { + "buildMs": 1109.4135419999998, + "peakRssMiB": 658.078125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 136757248, + "heapTotal": 59326464, + "heapUsed": 23141904, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 668958720, + "heapTotal": 245055488, + "heapUsed": 55120264, + "external": 15042270, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 668319744, + "heapTotal": 180043776, + "heapUsed": 42337840, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1423.419708 + }, + { + "buildMs": 1106.5845, + "peakRssMiB": 656.21875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 138280960, + "heapTotal": 59588608, + "heapUsed": 23147672, + "external": 4398448, + "arrayBuffers": 55727 + }, + "after": { + "rss": 666796032, + "heapTotal": 247414784, + "heapUsed": 54438056, + "external": 15042270, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 665878528, + "heapTotal": 178995200, + "heapUsed": 42341104, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1418.826333 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-256-profile.json b/benchmarks/compiler/results/final-cache-250-256-profile.json new file mode 100644 index 00000000000..d41eb8988b7 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-256-profile.json @@ -0,0 +1,330 @@ +{ + "timestamp": "2026-09-26T14:38:25.495Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 256, + "summary": { + "medianBuildMs": 1057.2319169999998, + "medianPeakRssMiB": 573.03125, + "medianWallMs": 1377.349917 + }, + "samples": [ + { + "buildMs": 1057.2319169999998, + "peakRssMiB": 573.03125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 133562368, + "heapTotal": 59326464, + "heapUsed": 23146104, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 581779456, + "heapTotal": 207306752, + "heapUsed": 54054064, + "external": 5655806, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 581812224, + "heapTotal": 178470912, + "heapUsed": 41419872, + "external": 5639422, + "arrayBuffers": 68485 + }, + "analyzerCalls": 251, + "analysesByFile": { + "routes/route-0001.tsx": 1, + "routes/route-0000.tsx": 1, + "routes/__root.tsx": 1, + "routes/route-0012.tsx": 1, + "routes/route-0004.tsx": 1, + "routes/route-0008.tsx": 1, + "routes/route-0009.tsx": 1, + "routes/route-0005.tsx": 1, + "routes/route-0002.tsx": 1, + "routes/route-0010.tsx": 1, + "routes/route-0003.tsx": 1, + "routes/route-0006.tsx": 1, + "routes/route-0017.tsx": 1, + "routes/route-0015.tsx": 1, + "routes/route-0011.tsx": 1, + "routes/route-0026.tsx": 1, + "routes/route-0014.tsx": 1, + "routes/route-0016.tsx": 1, + "routes/route-0031.tsx": 1, + "routes/route-0018.tsx": 1, + "routes/route-0035.tsx": 1, + "routes/route-0033.tsx": 1, + "routes/route-0027.tsx": 1, + "routes/route-0019.tsx": 1, + "routes/route-0034.tsx": 1, + "routes/route-0032.tsx": 1, + "routes/route-0029.tsx": 1, + "routes/route-0028.tsx": 1, + "routes/route-0020.tsx": 1, + "routes/route-0021.tsx": 1, + "routes/route-0007.tsx": 1, + "routes/route-0030.tsx": 1, + "routes/route-0043.tsx": 1, + "routes/route-0022.tsx": 1, + "routes/route-0013.tsx": 1, + "routes/route-0023.tsx": 1, + "routes/route-0025.tsx": 1, + "routes/route-0036.tsx": 1, + "routes/route-0024.tsx": 1, + "routes/route-0059.tsx": 1, + "routes/route-0051.tsx": 1, + "routes/route-0047.tsx": 1, + "routes/route-0052.tsx": 1, + "routes/route-0039.tsx": 1, + "routes/route-0044.tsx": 1, + "routes/route-0037.tsx": 1, + "routes/route-0045.tsx": 1, + "routes/route-0048.tsx": 1, + "routes/route-0040.tsx": 1, + "routes/route-0053.tsx": 1, + "routes/route-0054.tsx": 1, + "routes/route-0073.tsx": 1, + "routes/route-0049.tsx": 1, + "routes/route-0056.tsx": 1, + "routes/route-0046.tsx": 1, + "routes/route-0041.tsx": 1, + "routes/route-0055.tsx": 1, + "routes/route-0057.tsx": 1, + "routes/route-0058.tsx": 1, + "routes/route-0060.tsx": 1, + "routes/route-0050.tsx": 1, + "routes/route-0089.tsx": 1, + "routes/route-0081.tsx": 1, + "routes/route-0082.tsx": 1, + "routes/route-0074.tsx": 1, + "routes/route-0067.tsx": 1, + "routes/route-0038.tsx": 1, + "routes/route-0085.tsx": 1, + "routes/route-0062.tsx": 1, + "routes/route-0061.tsx": 1, + "routes/route-0086.tsx": 1, + "routes/route-0066.tsx": 1, + "routes/route-0075.tsx": 1, + "routes/route-0071.tsx": 1, + "routes/route-0063.tsx": 1, + "routes/route-0087.tsx": 1, + "routes/route-0076.tsx": 1, + "routes/route-0083.tsx": 1, + "routes/route-0084.tsx": 1, + "routes/route-0088.tsx": 1, + "routes/route-0072.tsx": 1, + "routes/route-0077.tsx": 1, + "routes/route-0118.tsx": 1, + "routes/route-0064.tsx": 1, + "routes/route-0065.tsx": 1, + "routes/route-0096.tsx": 1, + "routes/route-0103.tsx": 1, + "routes/route-0092.tsx": 1, + "routes/route-0099.tsx": 1, + "routes/route-0104.tsx": 1, + "routes/route-0127.tsx": 1, + "routes/route-0090.tsx": 1, + "routes/route-0137.tsx": 1, + "routes/route-0105.tsx": 1, + "routes/route-0093.tsx": 1, + "routes/route-0112.tsx": 1, + "routes/route-0097.tsx": 1, + "routes/route-0042.tsx": 1, + "routes/route-0119.tsx": 1, + "routes/route-0098.tsx": 1, + "routes/route-0078.tsx": 1, + "routes/route-0111.tsx": 1, + "routes/route-0120.tsx": 1, + "routes/route-0091.tsx": 1, + "routes/route-0113.tsx": 1, + "routes/route-0109.tsx": 1, + "routes/route-0094.tsx": 1, + "routes/route-0070.tsx": 1, + "routes/route-0123.tsx": 1, + "routes/route-0124.tsx": 1, + "routes/route-0114.tsx": 1, + "routes/route-0108.tsx": 1, + "routes/route-0095.tsx": 1, + "routes/route-0122.tsx": 1, + "routes/route-0101.tsx": 1, + "routes/route-0110.tsx": 1, + "routes/route-0121.tsx": 1, + "routes/route-0125.tsx": 1, + "routes/route-0115.tsx": 1, + "routes/route-0116.tsx": 1, + "routes/route-0126.tsx": 1, + "routes/route-0117.tsx": 1, + "routes/route-0132.tsx": 1, + "routes/route-0107.tsx": 1, + "routes/route-0134.tsx": 1, + "routes/route-0106.tsx": 1, + "routes/route-0133.tsx": 1, + "routes/route-0080.tsx": 1, + "routes/route-0130.tsx": 1, + "routes/route-0135.tsx": 1, + "routes/route-0131.tsx": 1, + "routes/route-0129.tsx": 1, + "routes/route-0136.tsx": 1, + "routes/route-0150.tsx": 1, + "routes/route-0140.tsx": 1, + "routes/route-0144.tsx": 1, + "routes/route-0148.tsx": 1, + "routes/route-0157.tsx": 1, + "routes/route-0147.tsx": 1, + "routes/route-0153.tsx": 1, + "routes/route-0146.tsx": 1, + "routes/route-0145.tsx": 1, + "routes/route-0138.tsx": 1, + "routes/route-0149.tsx": 1, + "routes/route-0143.tsx": 1, + "routes/route-0154.tsx": 1, + "routes/route-0139.tsx": 1, + "routes/route-0160.tsx": 1, + "routes/route-0161.tsx": 1, + "routes/route-0141.tsx": 1, + "routes/route-0155.tsx": 1, + "routes/route-0163.tsx": 1, + "routes/route-0158.tsx": 1, + "routes/route-0193.tsx": 1, + "routes/route-0208.tsx": 1, + "routes/route-0156.tsx": 1, + "routes/route-0213.tsx": 1, + "routes/route-0079.tsx": 1, + "routes/route-0194.tsx": 1, + "routes/route-0219.tsx": 1, + "routes/route-0209.tsx": 1, + "routes/route-0216.tsx": 1, + "routes/route-0165.tsx": 1, + "routes/route-0210.tsx": 1, + "routes/route-0159.tsx": 1, + "routes/route-0214.tsx": 1, + "routes/route-0211.tsx": 1, + "routes/route-0166.tsx": 1, + "routes/route-0212.tsx": 1, + "routes/route-0069.tsx": 1, + "routes/route-0100.tsx": 1, + "routes/route-0218.tsx": 1, + "routes/route-0249.tsx": 1, + "routes/route-0220.tsx": 1, + "routes/route-0167.tsx": 1, + "routes/route-0234.tsx": 1, + "routes/route-0217.tsx": 1, + "routes/route-0248.tsx": 1, + "routes/route-0241.tsx": 1, + "routes/route-0235.tsx": 1, + "routes/route-0168.tsx": 1, + "routes/route-0238.tsx": 1, + "routes/route-0247.tsx": 1, + "routes/route-0239.tsx": 1, + "routes/route-0201.tsx": 1, + "routes/route-0236.tsx": 1, + "routes/route-0245.tsx": 1, + "routes/route-0169.tsx": 1, + "routes/route-0240.tsx": 1, + "routes/route-0196.tsx": 1, + "routes/route-0237.tsx": 1, + "routes/route-0242.tsx": 1, + "routes/route-0170.tsx": 1, + "routes/route-0197.tsx": 1, + "routes/route-0246.tsx": 1, + "routes/route-0128.tsx": 1, + "routes/route-0243.tsx": 1, + "routes/route-0199.tsx": 1, + "routes/route-0102.tsx": 1, + "routes/route-0200.tsx": 1, + "routes/route-0202.tsx": 1, + "routes/route-0164.tsx": 1, + "routes/route-0206.tsx": 1, + "routes/route-0151.tsx": 1, + "routes/route-0152.tsx": 1, + "routes/route-0171.tsx": 1, + "routes/route-0172.tsx": 1, + "routes/route-0203.tsx": 1, + "routes/route-0205.tsx": 1, + "routes/route-0187.tsx": 1, + "routes/route-0177.tsx": 1, + "routes/route-0207.tsx": 1, + "routes/route-0182.tsx": 1, + "routes/route-0190.tsx": 1, + "routes/route-0179.tsx": 1, + "routes/route-0178.tsx": 1, + "routes/route-0183.tsx": 1, + "routes/route-0173.tsx": 1, + "routes/route-0188.tsx": 1, + "routes/route-0191.tsx": 1, + "routes/route-0180.tsx": 1, + "routes/route-0227.tsx": 1, + "routes/route-0174.tsx": 1, + "routes/route-0184.tsx": 1, + "routes/route-0162.tsx": 1, + "routes/route-0189.tsx": 1, + "routes/route-0175.tsx": 1, + "routes/route-0181.tsx": 1, + "routes/route-0185.tsx": 1, + "routes/route-0225.tsx": 1, + "routes/route-0186.tsx": 1, + "routes/route-0224.tsx": 1, + "routes/route-0176.tsx": 1, + "routes/route-0228.tsx": 1, + "routes/route-0226.tsx": 1, + "routes/route-0068.tsx": 1, + "routes/route-0233.tsx": 1, + "routes/route-0230.tsx": 1, + "routes/route-0222.tsx": 1, + "routes/route-0142.tsx": 1, + "routes/route-0232.tsx": 1, + "routes/route-0195.tsx": 1, + "routes/route-0231.tsx": 1, + "routes/route-0215.tsx": 1, + "routes/route-0223.tsx": 1, + "routes/route-0204.tsx": 1, + "routes/route-0244.tsx": 1, + "routes/route-0198.tsx": 1, + "routes/route-0192.tsx": 1, + "routes/route-0229.tsx": 1, + "routes/route-0221.tsx": 1 + }, + "liveCache": { + "entries": 251, + "beforeClear": { + "rss": 466829312, + "heapTotal": 200753152, + "heapUsed": 50325816, + "external": 10914110, + "arrayBuffers": 3198549 + }, + "afterClear": { + "rss": 465944576, + "heapTotal": 182140928, + "heapUsed": 35414816, + "external": 7065550, + "arrayBuffers": 1182829 + } + }, + "wallMs": 1377.349917 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-256-timing.json b/benchmarks/compiler/results/final-cache-250-256-timing.json new file mode 100644 index 00000000000..4312b83f9b3 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-256-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:38:29.536Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 256, + "summary": { + "medianBuildMs": 1028.042, + "medianPeakRssMiB": 624.078125, + "medianWallMs": 1326.787583 + }, + "samples": [ + { + "buildMs": 1025.436291, + "peakRssMiB": 647.1875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 137248768, + "heapTotal": 59850752, + "heapUsed": 23145616, + "external": 4398448, + "arrayBuffers": 54783 + }, + "after": { + "rss": 657981440, + "heapTotal": 217268224, + "heapUsed": 48240528, + "external": 8774538, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 656900096, + "heapTotal": 179257344, + "heapUsed": 42277360, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1326.787583 + }, + { + "buildMs": 1028.042, + "peakRssMiB": 618.203125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 132415488, + "heapTotal": 59326464, + "heapUsed": 23145448, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 626343936, + "heapTotal": 226443264, + "heapUsed": 54413088, + "external": 8790778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 625459200, + "heapTotal": 178733056, + "heapUsed": 42272176, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1314.3319589999999 + }, + { + "buildMs": 1053.032459, + "peakRssMiB": 624.078125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 139018240, + "heapTotal": 59588608, + "heapUsed": 23146000, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 633569280, + "heapTotal": 221986816, + "heapUsed": 55308536, + "external": 8790778, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 633241600, + "heapTotal": 180568064, + "heapUsed": 42278056, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1342.460458 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-512-profile.json b/benchmarks/compiler/results/final-cache-250-512-profile.json new file mode 100644 index 00000000000..2166fb07ae7 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-512-profile.json @@ -0,0 +1,330 @@ +{ + "timestamp": "2026-09-26T14:38:30.926Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 512, + "summary": { + "medianBuildMs": 1047.989, + "medianPeakRssMiB": 584.6875, + "medianWallMs": 1336.558042 + }, + "samples": [ + { + "buildMs": 1047.989, + "peakRssMiB": 584.6875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 134922240, + "heapTotal": 59064320, + "heapUsed": 23146064, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 593985536, + "heapTotal": 206258176, + "heapUsed": 54150904, + "external": 5655806, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 594395136, + "heapTotal": 179257344, + "heapUsed": 41427632, + "external": 5639422, + "arrayBuffers": 68485 + }, + "analyzerCalls": 251, + "analysesByFile": { + "routes/route-0002.tsx": 1, + "routes/route-0004.tsx": 1, + "routes/route-0000.tsx": 1, + "routes/route-0013.tsx": 1, + "routes/route-0001.tsx": 1, + "routes/route-0018.tsx": 1, + "routes/route-0017.tsx": 1, + "routes/route-0022.tsx": 1, + "routes/route-0005.tsx": 1, + "routes/route-0014.tsx": 1, + "routes/route-0006.tsx": 1, + "routes/route-0019.tsx": 1, + "routes/route-0015.tsx": 1, + "routes/__root.tsx": 1, + "routes/route-0003.tsx": 1, + "routes/route-0007.tsx": 1, + "routes/route-0016.tsx": 1, + "routes/route-0021.tsx": 1, + "routes/route-0020.tsx": 1, + "routes/route-0008.tsx": 1, + "routes/route-0009.tsx": 1, + "routes/route-0011.tsx": 1, + "routes/route-0012.tsx": 1, + "routes/route-0044.tsx": 1, + "routes/route-0056.tsx": 1, + "routes/route-0023.tsx": 1, + "routes/route-0034.tsx": 1, + "routes/route-0045.tsx": 1, + "routes/route-0035.tsx": 1, + "routes/route-0010.tsx": 1, + "routes/route-0024.tsx": 1, + "routes/route-0046.tsx": 1, + "routes/route-0036.tsx": 1, + "routes/route-0025.tsx": 1, + "routes/route-0047.tsx": 1, + "routes/route-0037.tsx": 1, + "routes/route-0033.tsx": 1, + "routes/route-0026.tsx": 1, + "routes/route-0048.tsx": 1, + "routes/route-0038.tsx": 1, + "routes/route-0049.tsx": 1, + "routes/route-0039.tsx": 1, + "routes/route-0050.tsx": 1, + "routes/route-0028.tsx": 1, + "routes/route-0029.tsx": 1, + "routes/route-0027.tsx": 1, + "routes/route-0052.tsx": 1, + "routes/route-0030.tsx": 1, + "routes/route-0031.tsx": 1, + "routes/route-0051.tsx": 1, + "routes/route-0054.tsx": 1, + "routes/route-0053.tsx": 1, + "routes/route-0098.tsx": 1, + "routes/route-0032.tsx": 1, + "routes/route-0040.tsx": 1, + "routes/route-0080.tsx": 1, + "routes/route-0094.tsx": 1, + "routes/route-0093.tsx": 1, + "routes/route-0055.tsx": 1, + "routes/route-0042.tsx": 1, + "routes/route-0095.tsx": 1, + "routes/route-0090.tsx": 1, + "routes/route-0091.tsx": 1, + "routes/route-0041.tsx": 1, + "routes/route-0082.tsx": 1, + "routes/route-0096.tsx": 1, + "routes/route-0097.tsx": 1, + "routes/route-0092.tsx": 1, + "routes/route-0081.tsx": 1, + "routes/route-0146.tsx": 1, + "routes/route-0084.tsx": 1, + "routes/route-0067.tsx": 1, + "routes/route-0061.tsx": 1, + "routes/route-0130.tsx": 1, + "routes/route-0062.tsx": 1, + "routes/route-0083.tsx": 1, + "routes/route-0043.tsx": 1, + "routes/route-0057.tsx": 1, + "routes/route-0129.tsx": 1, + "routes/route-0063.tsx": 1, + "routes/route-0058.tsx": 1, + "routes/route-0079.tsx": 1, + "routes/route-0064.tsx": 1, + "routes/route-0059.tsx": 1, + "routes/route-0068.tsx": 1, + "routes/route-0099.tsx": 1, + "routes/route-0065.tsx": 1, + "routes/route-0070.tsx": 1, + "routes/route-0069.tsx": 1, + "routes/route-0066.tsx": 1, + "routes/route-0071.tsx": 1, + "routes/route-0100.tsx": 1, + "routes/route-0131.tsx": 1, + "routes/route-0060.tsx": 1, + "routes/route-0072.tsx": 1, + "routes/route-0089.tsx": 1, + "routes/route-0132.tsx": 1, + "routes/route-0073.tsx": 1, + "routes/route-0101.tsx": 1, + "routes/route-0133.tsx": 1, + "routes/route-0085.tsx": 1, + "routes/route-0179.tsx": 1, + "routes/route-0086.tsx": 1, + "routes/route-0195.tsx": 1, + "routes/route-0163.tsx": 1, + "routes/route-0074.tsx": 1, + "routes/route-0180.tsx": 1, + "routes/route-0162.tsx": 1, + "routes/route-0208.tsx": 1, + "routes/route-0075.tsx": 1, + "routes/route-0076.tsx": 1, + "routes/route-0181.tsx": 1, + "routes/route-0164.tsx": 1, + "routes/route-0087.tsx": 1, + "routes/route-0147.tsx": 1, + "routes/route-0077.tsx": 1, + "routes/route-0196.tsx": 1, + "routes/route-0182.tsx": 1, + "routes/route-0165.tsx": 1, + "routes/route-0078.tsx": 1, + "routes/route-0197.tsx": 1, + "routes/route-0088.tsx": 1, + "routes/route-0166.tsx": 1, + "routes/route-0148.tsx": 1, + "routes/route-0198.tsx": 1, + "routes/route-0172.tsx": 1, + "routes/route-0176.tsx": 1, + "routes/route-0149.tsx": 1, + "routes/route-0167.tsx": 1, + "routes/route-0134.tsx": 1, + "routes/route-0177.tsx": 1, + "routes/route-0102.tsx": 1, + "routes/route-0150.tsx": 1, + "routes/route-0168.tsx": 1, + "routes/route-0135.tsx": 1, + "routes/route-0178.tsx": 1, + "routes/route-0140.tsx": 1, + "routes/route-0169.tsx": 1, + "routes/route-0151.tsx": 1, + "routes/route-0183.tsx": 1, + "routes/route-0141.tsx": 1, + "routes/route-0170.tsx": 1, + "routes/route-0173.tsx": 1, + "routes/route-0184.tsx": 1, + "routes/route-0142.tsx": 1, + "routes/route-0136.tsx": 1, + "routes/route-0152.tsx": 1, + "routes/route-0116.tsx": 1, + "routes/route-0185.tsx": 1, + "routes/route-0171.tsx": 1, + "routes/route-0137.tsx": 1, + "routes/route-0143.tsx": 1, + "routes/route-0157.tsx": 1, + "routes/route-0186.tsx": 1, + "routes/route-0175.tsx": 1, + "routes/route-0138.tsx": 1, + "routes/route-0144.tsx": 1, + "routes/route-0249.tsx": 1, + "routes/route-0187.tsx": 1, + "routes/route-0155.tsx": 1, + "routes/route-0153.tsx": 1, + "routes/route-0145.tsx": 1, + "routes/route-0209.tsx": 1, + "routes/route-0156.tsx": 1, + "routes/route-0188.tsx": 1, + "routes/route-0139.tsx": 1, + "routes/route-0158.tsx": 1, + "routes/route-0191.tsx": 1, + "routes/route-0110.tsx": 1, + "routes/route-0192.tsx": 1, + "routes/route-0199.tsx": 1, + "routes/route-0210.tsx": 1, + "routes/route-0105.tsx": 1, + "routes/route-0189.tsx": 1, + "routes/route-0211.tsx": 1, + "routes/route-0159.tsx": 1, + "routes/route-0200.tsx": 1, + "routes/route-0106.tsx": 1, + "routes/route-0212.tsx": 1, + "routes/route-0193.tsx": 1, + "routes/route-0201.tsx": 1, + "routes/route-0190.tsx": 1, + "routes/route-0213.tsx": 1, + "routes/route-0107.tsx": 1, + "routes/route-0113.tsx": 1, + "routes/route-0114.tsx": 1, + "routes/route-0202.tsx": 1, + "routes/route-0108.tsx": 1, + "routes/route-0103.tsx": 1, + "routes/route-0214.tsx": 1, + "routes/route-0203.tsx": 1, + "routes/route-0111.tsx": 1, + "routes/route-0174.tsx": 1, + "routes/route-0215.tsx": 1, + "routes/route-0204.tsx": 1, + "routes/route-0117.tsx": 1, + "routes/route-0123.tsx": 1, + "routes/route-0216.tsx": 1, + "routes/route-0112.tsx": 1, + "routes/route-0205.tsx": 1, + "routes/route-0232.tsx": 1, + "routes/route-0126.tsx": 1, + "routes/route-0118.tsx": 1, + "routes/route-0233.tsx": 1, + "routes/route-0207.tsx": 1, + "routes/route-0127.tsx": 1, + "routes/route-0217.tsx": 1, + "routes/route-0234.tsx": 1, + "routes/route-0124.tsx": 1, + "routes/route-0206.tsx": 1, + "routes/route-0119.tsx": 1, + "routes/route-0218.tsx": 1, + "routes/route-0161.tsx": 1, + "routes/route-0125.tsx": 1, + "routes/route-0128.tsx": 1, + "routes/route-0235.tsx": 1, + "routes/route-0219.tsx": 1, + "routes/route-0121.tsx": 1, + "routes/route-0120.tsx": 1, + "routes/route-0243.tsx": 1, + "routes/route-0104.tsx": 1, + "routes/route-0247.tsx": 1, + "routes/route-0220.tsx": 1, + "routes/route-0246.tsx": 1, + "routes/route-0236.tsx": 1, + "routes/route-0242.tsx": 1, + "routes/route-0248.tsx": 1, + "routes/route-0237.tsx": 1, + "routes/route-0244.tsx": 1, + "routes/route-0221.tsx": 1, + "routes/route-0238.tsx": 1, + "routes/route-0154.tsx": 1, + "routes/route-0240.tsx": 1, + "routes/route-0245.tsx": 1, + "routes/route-0239.tsx": 1, + "routes/route-0227.tsx": 1, + "routes/route-0194.tsx": 1, + "routes/route-0230.tsx": 1, + "routes/route-0229.tsx": 1, + "routes/route-0231.tsx": 1, + "routes/route-0115.tsx": 1, + "routes/route-0225.tsx": 1, + "routes/route-0224.tsx": 1, + "routes/route-0109.tsx": 1, + "routes/route-0241.tsx": 1, + "routes/route-0122.tsx": 1, + "routes/route-0226.tsx": 1, + "routes/route-0222.tsx": 1, + "routes/route-0228.tsx": 1, + "routes/route-0223.tsx": 1, + "routes/route-0160.tsx": 1 + }, + "liveCache": { + "entries": 251, + "beforeClear": { + "rss": 467828736, + "heapTotal": 199180288, + "heapUsed": 50334952, + "external": 11014822, + "arrayBuffers": 3198549 + }, + "afterClear": { + "rss": 467369984, + "heapTotal": 184762368, + "heapUsed": 35422976, + "external": 7065550, + "arrayBuffers": 1408045 + } + }, + "wallMs": 1336.558042 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-250-512-timing.json b/benchmarks/compiler/results/final-cache-250-512-timing.json new file mode 100644 index 00000000000..55c11c293f8 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-250-512-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:38:34.980Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 250, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 512, + "summary": { + "medianBuildMs": 1040.035083, + "medianPeakRssMiB": 642.953125, + "medianWallMs": 1336.935708 + }, + "samples": [ + { + "buildMs": 1035.879042, + "peakRssMiB": 645.140625, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 134168576, + "heapTotal": 59326464, + "heapUsed": 23145456, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 674775040, + "heapTotal": 297484288, + "heapUsed": 176548088, + "external": 8786270, + "arrayBuffers": 3198949 + }, + "retained": { + "rss": 657162240, + "heapTotal": 220938240, + "heapUsed": 42309048, + "external": 8769886, + "arrayBuffers": 68485 + }, + "wallMs": 1325.1752920000001 + }, + { + "buildMs": 1049.598625, + "peakRssMiB": 618.8125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 138362880, + "heapTotal": 59326464, + "heapUsed": 23145320, + "external": 4398448, + "arrayBuffers": 76167 + }, + "after": { + "rss": 627802112, + "heapTotal": 228802560, + "heapUsed": 54422776, + "external": 8786270, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 626851840, + "heapTotal": 179781632, + "heapUsed": 42283416, + "external": 5639422, + "arrayBuffers": 68485 + }, + "wallMs": 1339.615875 + }, + { + "buildMs": 1040.035083, + "peakRssMiB": 642.953125, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 139771904, + "heapTotal": 58802176, + "heapUsed": 23134640, + "external": 4398448, + "arrayBuffers": 44335 + }, + "after": { + "rss": 673677312, + "heapTotal": 298795008, + "heapUsed": 177685552, + "external": 8790778, + "arrayBuffers": 3203457 + }, + "retained": { + "rss": 654491648, + "heapTotal": 222248960, + "heapUsed": 42309856, + "external": 8774394, + "arrayBuffers": 68485 + }, + "wallMs": 1336.935708 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-128-profile.json b/benchmarks/compiler/results/final-cache-750-128-profile.json new file mode 100644 index 00000000000..f2a42455fc2 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-128-profile.json @@ -0,0 +1,830 @@ +{ + "timestamp": "2026-09-26T14:38:38.233Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 128, + "summary": { + "medianBuildMs": 2738.240167, + "medianPeakRssMiB": 1104.796875, + "medianWallMs": 3196.999208 + }, + "samples": [ + { + "buildMs": 2738.240167, + "peakRssMiB": 1104.796875, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 140460032, + "heapTotal": 59588608, + "heapUsed": 23218848, + "external": 3987768, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1158447104, + "heapTotal": 315834368, + "heapUsed": 219093512, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1128120320, + "heapTotal": 232800256, + "heapUsed": 56317960, + "external": 6950142, + "arrayBuffers": 68485 + }, + "analyzerCalls": 2251, + "analysesByFile": { + "routes/route-0001.tsx": 3, + "routes/route-0000.tsx": 3, + "routes/route-0013.tsx": 3, + "routes/route-0006.tsx": 3, + "routes/route-0010.tsx": 3, + "routes/route-0007.tsx": 3, + "routes/__root.tsx": 1, + "routes/route-0011.tsx": 3, + "routes/route-0002.tsx": 3, + "routes/route-0009.tsx": 3, + "routes/route-0004.tsx": 3, + "routes/route-0008.tsx": 3, + "routes/route-0003.tsx": 3, + "routes/route-0033.tsx": 3, + "routes/route-0026.tsx": 3, + "routes/route-0038.tsx": 3, + "routes/route-0015.tsx": 3, + "routes/route-0012.tsx": 3, + "routes/route-0027.tsx": 3, + "routes/route-0028.tsx": 3, + "routes/route-0005.tsx": 3, + "routes/route-0016.tsx": 3, + "routes/route-0037.tsx": 3, + "routes/route-0014.tsx": 3, + "routes/route-0031.tsx": 3, + "routes/route-0032.tsx": 3, + "routes/route-0051.tsx": 3, + "routes/route-0034.tsx": 3, + "routes/route-0017.tsx": 3, + "routes/route-0022.tsx": 3, + "routes/route-0029.tsx": 3, + "routes/route-0039.tsx": 3, + "routes/route-0018.tsx": 3, + "routes/route-0019.tsx": 3, + "routes/route-0021.tsx": 3, + "routes/route-0023.tsx": 3, + "routes/route-0020.tsx": 3, + "routes/route-0024.tsx": 3, + "routes/route-0025.tsx": 3, + "routes/route-0035.tsx": 3, + "routes/route-0040.tsx": 3, + "routes/route-0036.tsx": 3, + "routes/route-0041.tsx": 3, + "routes/route-0030.tsx": 3, + "routes/route-0048.tsx": 3, + "routes/route-0047.tsx": 3, + "routes/route-0052.tsx": 3, + "routes/route-0046.tsx": 3, + "routes/route-0042.tsx": 3, + "routes/route-0084.tsx": 3, + "routes/route-0049.tsx": 3, + "routes/route-0050.tsx": 3, + "routes/route-0077.tsx": 3, + "routes/route-0053.tsx": 3, + "routes/route-0044.tsx": 3, + "routes/route-0076.tsx": 3, + "routes/route-0043.tsx": 3, + "routes/route-0068.tsx": 3, + "routes/route-0045.tsx": 3, + "routes/route-0070.tsx": 3, + "routes/route-0069.tsx": 3, + "routes/route-0078.tsx": 3, + "routes/route-0081.tsx": 3, + "routes/route-0054.tsx": 3, + "routes/route-0114.tsx": 3, + "routes/route-0073.tsx": 3, + "routes/route-0099.tsx": 3, + "routes/route-0082.tsx": 3, + "routes/route-0055.tsx": 3, + "routes/route-0083.tsx": 3, + "routes/route-0074.tsx": 3, + "routes/route-0071.tsx": 3, + "routes/route-0075.tsx": 3, + "routes/route-0139.tsx": 3, + "routes/route-0072.tsx": 3, + "routes/route-0115.tsx": 3, + "routes/route-0100.tsx": 3, + "routes/route-0056.tsx": 3, + "routes/route-0156.tsx": 3, + "routes/route-0127.tsx": 3, + "routes/route-0140.tsx": 3, + "routes/route-0107.tsx": 3, + "routes/route-0101.tsx": 3, + "routes/route-0116.tsx": 3, + "routes/route-0057.tsx": 3, + "routes/route-0103.tsx": 3, + "routes/route-0108.tsx": 3, + "routes/route-0102.tsx": 3, + "routes/route-0141.tsx": 3, + "routes/route-0058.tsx": 3, + "routes/route-0111.tsx": 3, + "routes/route-0109.tsx": 3, + "routes/route-0142.tsx": 3, + "routes/route-0085.tsx": 3, + "routes/route-0104.tsx": 3, + "routes/route-0128.tsx": 3, + "routes/route-0143.tsx": 3, + "routes/route-0110.tsx": 3, + "routes/route-0086.tsx": 3, + "routes/route-0105.tsx": 3, + "routes/route-0112.tsx": 3, + "routes/route-0177.tsx": 3, + "routes/route-0129.tsx": 3, + "routes/route-0134.tsx": 3, + "routes/route-0059.tsx": 3, + "routes/route-0130.tsx": 3, + "routes/route-0087.tsx": 3, + "routes/route-0088.tsx": 3, + "routes/route-0157.tsx": 3, + "routes/route-0060.tsx": 3, + "routes/route-0132.tsx": 3, + "routes/route-0133.tsx": 3, + "routes/route-0089.tsx": 3, + "routes/route-0090.tsx": 3, + "routes/route-0131.tsx": 3, + "routes/route-0079.tsx": 3, + "routes/route-0117.tsx": 3, + "routes/route-0106.tsx": 3, + "routes/route-0095.tsx": 3, + "routes/route-0094.tsx": 3, + "routes/route-0137.tsx": 3, + "routes/route-0118.tsx": 3, + "routes/route-0080.tsx": 3, + "routes/route-0061.tsx": 3, + "routes/route-0096.tsx": 3, + "routes/route-0136.tsx": 3, + "routes/route-0091.tsx": 3, + "routes/route-0119.tsx": 3, + "routes/route-0064.tsx": 3, + "routes/route-0065.tsx": 3, + "routes/route-0062.tsx": 3, + "routes/route-0167.tsx": 3, + "routes/route-0135.tsx": 3, + "routes/route-0144.tsx": 3, + "routes/route-0063.tsx": 3, + "routes/route-0159.tsx": 3, + "routes/route-0158.tsx": 3, + "routes/route-0098.tsx": 3, + "routes/route-0145.tsx": 3, + "routes/route-0160.tsx": 3, + "routes/route-0138.tsx": 3, + "routes/route-0150.tsx": 3, + "routes/route-0168.tsx": 3, + "routes/route-0161.tsx": 3, + "routes/route-0113.tsx": 3, + "routes/route-0092.tsx": 3, + "routes/route-0097.tsx": 3, + "routes/route-0162.tsx": 3, + "routes/route-0093.tsx": 3, + "routes/route-0146.tsx": 3, + "routes/route-0120.tsx": 3, + "routes/route-0163.tsx": 3, + "routes/route-0147.tsx": 3, + "routes/route-0164.tsx": 3, + "routes/route-0165.tsx": 3, + "routes/route-0169.tsx": 3, + "routes/route-0148.tsx": 3, + "routes/route-0121.tsx": 3, + "routes/route-0066.tsx": 3, + "routes/route-0151.tsx": 3, + "routes/route-0149.tsx": 3, + "routes/route-0170.tsx": 3, + "routes/route-0173.tsx": 3, + "routes/route-0152.tsx": 3, + "routes/route-0171.tsx": 3, + "routes/route-0176.tsx": 3, + "routes/route-0175.tsx": 3, + "routes/route-0172.tsx": 3, + "routes/route-0123.tsx": 3, + "routes/route-0124.tsx": 3, + "routes/route-0155.tsx": 3, + "routes/route-0125.tsx": 3, + "routes/route-0246.tsx": 3, + "routes/route-0126.tsx": 3, + "routes/route-0154.tsx": 3, + "routes/route-0281.tsx": 3, + "routes/route-0212.tsx": 3, + "routes/route-0211.tsx": 3, + "routes/route-0067.tsx": 3, + "routes/route-0153.tsx": 3, + "routes/route-0299.tsx": 3, + "routes/route-0213.tsx": 3, + "routes/route-0178.tsx": 3, + "routes/route-0247.tsx": 3, + "routes/route-0214.tsx": 3, + "routes/route-0292.tsx": 3, + "routes/route-0166.tsx": 3, + "routes/route-0304.tsx": 3, + "routes/route-0248.tsx": 3, + "routes/route-0179.tsx": 3, + "routes/route-0291.tsx": 3, + "routes/route-0215.tsx": 3, + "routes/route-0180.tsx": 3, + "routes/route-0283.tsx": 3, + "routes/route-0300.tsx": 3, + "routes/route-0249.tsx": 3, + "routes/route-0284.tsx": 3, + "routes/route-0122.tsx": 3, + "routes/route-0282.tsx": 3, + "routes/route-0182.tsx": 3, + "routes/route-0181.tsx": 3, + "routes/route-0174.tsx": 3, + "routes/route-0183.tsx": 3, + "routes/route-0250.tsx": 3, + "routes/route-0306.tsx": 3, + "routes/route-0302.tsx": 3, + "routes/route-0294.tsx": 3, + "routes/route-0297.tsx": 3, + "routes/route-0287.tsx": 3, + "routes/route-0301.tsx": 3, + "routes/route-0305.tsx": 3, + "routes/route-0184.tsx": 3, + "routes/route-0293.tsx": 3, + "routes/route-0286.tsx": 3, + "routes/route-0296.tsx": 3, + "routes/route-0295.tsx": 3, + "routes/route-0251.tsx": 3, + "routes/route-0197.tsx": 3, + "routes/route-0198.tsx": 3, + "routes/route-0303.tsx": 3, + "routes/route-0185.tsx": 3, + "routes/route-0266.tsx": 3, + "routes/route-0298.tsx": 3, + "routes/route-0307.tsx": 3, + "routes/route-0199.tsx": 3, + "routes/route-0205.tsx": 3, + "routes/route-0267.tsx": 3, + "routes/route-0186.tsx": 3, + "routes/route-0258.tsx": 3, + "routes/route-0238.tsx": 3, + "routes/route-0200.tsx": 3, + "routes/route-0259.tsx": 3, + "routes/route-0285.tsx": 3, + "routes/route-0206.tsx": 3, + "routes/route-0187.tsx": 3, + "routes/route-0232.tsx": 3, + "routes/route-0260.tsx": 3, + "routes/route-0201.tsx": 3, + "routes/route-0207.tsx": 3, + "routes/route-0188.tsx": 3, + "routes/route-0242.tsx": 3, + "routes/route-0252.tsx": 3, + "routes/route-0268.tsx": 3, + "routes/route-0233.tsx": 3, + "routes/route-0208.tsx": 3, + "routes/route-0189.tsx": 3, + "routes/route-0239.tsx": 3, + "routes/route-0269.tsx": 3, + "routes/route-0234.tsx": 3, + "routes/route-0253.tsx": 3, + "routes/route-0190.tsx": 3, + "routes/route-0209.tsx": 3, + "routes/route-0308.tsx": 3, + "routes/route-0216.tsx": 3, + "routes/route-0235.tsx": 3, + "routes/route-0191.tsx": 3, + "routes/route-0270.tsx": 3, + "routes/route-0254.tsx": 3, + "routes/route-0210.tsx": 3, + "routes/route-0243.tsx": 3, + "routes/route-0192.tsx": 3, + "routes/route-0241.tsx": 3, + "routes/route-0237.tsx": 3, + "routes/route-0236.tsx": 3, + "routes/route-0245.tsx": 3, + "routes/route-0271.tsx": 3, + "routes/route-0195.tsx": 3, + "routes/route-0255.tsx": 3, + "routes/route-0288.tsx": 3, + "routes/route-0193.tsx": 3, + "routes/route-0223.tsx": 3, + "routes/route-0219.tsx": 3, + "routes/route-0194.tsx": 3, + "routes/route-0196.tsx": 3, + "routes/route-0256.tsx": 3, + "routes/route-0217.tsx": 3, + "routes/route-0220.tsx": 3, + "routes/route-0272.tsx": 3, + "routes/route-0263.tsx": 3, + "routes/route-0290.tsx": 3, + "routes/route-0203.tsx": 3, + "routes/route-0218.tsx": 3, + "routes/route-0222.tsx": 3, + "routes/route-0257.tsx": 3, + "routes/route-0289.tsx": 3, + "routes/route-0273.tsx": 3, + "routes/route-0264.tsx": 3, + "routes/route-0262.tsx": 3, + "routes/route-0265.tsx": 3, + "routes/route-0309.tsx": 3, + "routes/route-0225.tsx": 3, + "routes/route-0227.tsx": 3, + "routes/route-0274.tsx": 3, + "routes/route-0226.tsx": 3, + "routes/route-0204.tsx": 3, + "routes/route-0434.tsx": 3, + "routes/route-0275.tsx": 3, + "routes/route-0230.tsx": 3, + "routes/route-0278.tsx": 3, + "routes/route-0350.tsx": 3, + "routes/route-0456.tsx": 3, + "routes/route-0392.tsx": 3, + "routes/route-0276.tsx": 3, + "routes/route-0445.tsx": 3, + "routes/route-0393.tsx": 3, + "routes/route-0231.tsx": 3, + "routes/route-0279.tsx": 3, + "routes/route-0394.tsx": 3, + "routes/route-0435.tsx": 3, + "routes/route-0202.tsx": 3, + "routes/route-0351.tsx": 3, + "routes/route-0436.tsx": 3, + "routes/route-0395.tsx": 3, + "routes/route-0352.tsx": 3, + "routes/route-0481.tsx": 3, + "routes/route-0440.tsx": 3, + "routes/route-0441.tsx": 3, + "routes/route-0280.tsx": 3, + "routes/route-0396.tsx": 3, + "routes/route-0437.tsx": 3, + "routes/route-0457.tsx": 3, + "routes/route-0470.tsx": 3, + "routes/route-0442.tsx": 3, + "routes/route-0397.tsx": 3, + "routes/route-0469.tsx": 3, + "routes/route-0438.tsx": 3, + "routes/route-0471.tsx": 3, + "routes/route-0443.tsx": 3, + "routes/route-0398.tsx": 3, + "routes/route-0261.tsx": 3, + "routes/route-0439.tsx": 3, + "routes/route-0444.tsx": 3, + "routes/route-0472.tsx": 3, + "routes/route-0399.tsx": 3, + "routes/route-0473.tsx": 3, + "routes/route-0458.tsx": 3, + "routes/route-0400.tsx": 3, + "routes/route-0451.tsx": 3, + "routes/route-0459.tsx": 3, + "routes/route-0453.tsx": 3, + "routes/route-0478.tsx": 3, + "routes/route-0401.tsx": 3, + "routes/route-0447.tsx": 3, + "routes/route-0452.tsx": 3, + "routes/route-0479.tsx": 3, + "routes/route-0240.tsx": 3, + "routes/route-0460.tsx": 3, + "routes/route-0402.tsx": 3, + "routes/route-0448.tsx": 3, + "routes/route-0480.tsx": 3, + "routes/route-0454.tsx": 3, + "routes/route-0461.tsx": 3, + "routes/route-0418.tsx": 3, + "routes/route-0449.tsx": 3, + "routes/route-0475.tsx": 3, + "routes/route-0419.tsx": 3, + "routes/route-0410.tsx": 3, + "routes/route-0462.tsx": 3, + "routes/route-0411.tsx": 3, + "routes/route-0420.tsx": 3, + "routes/route-0474.tsx": 3, + "routes/route-0244.tsx": 3, + "routes/route-0221.tsx": 3, + "routes/route-0463.tsx": 3, + "routes/route-0412.tsx": 3, + "routes/route-0421.tsx": 3, + "routes/route-0415.tsx": 3, + "routes/route-0455.tsx": 3, + "routes/route-0476.tsx": 3, + "routes/route-0422.tsx": 3, + "routes/route-0464.tsx": 3, + "routes/route-0416.tsx": 3, + "routes/route-0413.tsx": 3, + "routes/route-0417.tsx": 3, + "routes/route-0466.tsx": 3, + "routes/route-0423.tsx": 3, + "routes/route-0414.tsx": 3, + "routes/route-0467.tsx": 3, + "routes/route-0228.tsx": 3, + "routes/route-0372.tsx": 3, + "routes/route-0468.tsx": 3, + "routes/route-0362.tsx": 3, + "routes/route-0224.tsx": 3, + "routes/route-0229.tsx": 3, + "routes/route-0446.tsx": 3, + "routes/route-0367.tsx": 3, + "routes/route-0310.tsx": 3, + "routes/route-0384.tsx": 3, + "routes/route-0354.tsx": 3, + "routes/route-0387.tsx": 3, + "routes/route-0377.tsx": 3, + "routes/route-0406.tsx": 3, + "routes/route-0383.tsx": 3, + "routes/route-0311.tsx": 3, + "routes/route-0355.tsx": 3, + "routes/route-0364.tsx": 3, + "routes/route-0404.tsx": 3, + "routes/route-0312.tsx": 3, + "routes/route-0356.tsx": 3, + "routes/route-0373.tsx": 3, + "routes/route-0332.tsx": 3, + "routes/route-0374.tsx": 3, + "routes/route-0365.tsx": 3, + "routes/route-0405.tsx": 3, + "routes/route-0385.tsx": 3, + "routes/route-0357.tsx": 3, + "routes/route-0277.tsx": 3, + "routes/route-0375.tsx": 3, + "routes/route-0333.tsx": 3, + "routes/route-0358.tsx": 3, + "routes/route-0386.tsx": 3, + "routes/route-0334.tsx": 3, + "routes/route-0380.tsx": 3, + "routes/route-0359.tsx": 3, + "routes/route-0408.tsx": 3, + "routes/route-0366.tsx": 3, + "routes/route-0409.tsx": 3, + "routes/route-0335.tsx": 3, + "routes/route-0361.tsx": 3, + "routes/route-0353.tsx": 3, + "routes/route-0368.tsx": 3, + "routes/route-0336.tsx": 3, + "routes/route-0337.tsx": 3, + "routes/route-0477.tsx": 3, + "routes/route-0369.tsx": 3, + "routes/route-0593.tsx": 3, + "routes/route-0390.tsx": 3, + "routes/route-0338.tsx": 3, + "routes/route-0450.tsx": 3, + "routes/route-0403.tsx": 3, + "routes/route-0482.tsx": 3, + "routes/route-0339.tsx": 3, + "routes/route-0321.tsx": 3, + "routes/route-0389.tsx": 3, + "routes/route-0483.tsx": 3, + "routes/route-0391.tsx": 3, + "routes/route-0340.tsx": 3, + "routes/route-0317.tsx": 3, + "routes/route-0484.tsx": 3, + "routes/route-0313.tsx": 3, + "routes/route-0657.tsx": 3, + "routes/route-0485.tsx": 3, + "routes/route-0341.tsx": 3, + "routes/route-0345.tsx": 3, + "routes/route-0314.tsx": 3, + "routes/route-0318.tsx": 3, + "routes/route-0594.tsx": 3, + "routes/route-0342.tsx": 3, + "routes/route-0486.tsx": 3, + "routes/route-0595.tsx": 3, + "routes/route-0315.tsx": 3, + "routes/route-0319.tsx": 3, + "routes/route-0343.tsx": 3, + "routes/route-0382.tsx": 3, + "routes/route-0316.tsx": 3, + "routes/route-0596.tsx": 3, + "routes/route-0344.tsx": 3, + "routes/route-0320.tsx": 3, + "routes/route-0749.tsx": 3, + "routes/route-0381.tsx": 3, + "routes/route-0378.tsx": 3, + "routes/route-0597.tsx": 3, + "routes/route-0429.tsx": 3, + "routes/route-0370.tsx": 3, + "routes/route-0598.tsx": 3, + "routes/route-0465.tsx": 3, + "routes/route-0426.tsx": 3, + "routes/route-0424.tsx": 3, + "routes/route-0513.tsx": 3, + "routes/route-0427.tsx": 3, + "routes/route-0425.tsx": 3, + "routes/route-0488.tsx": 3, + "routes/route-0599.tsx": 3, + "routes/route-0628.tsx": 3, + "routes/route-0613.tsx": 3, + "routes/route-0629.tsx": 3, + "routes/route-0430.tsx": 3, + "routes/route-0348.tsx": 3, + "routes/route-0363.tsx": 3, + "routes/route-0489.tsx": 3, + "routes/route-0331.tsx": 3, + "routes/route-0614.tsx": 3, + "routes/route-0630.tsx": 3, + "routes/route-0347.tsx": 3, + "routes/route-0371.tsx": 3, + "routes/route-0490.tsx": 3, + "routes/route-0631.tsx": 3, + "routes/route-0376.tsx": 3, + "routes/route-0615.tsx": 3, + "routes/route-0579.tsx": 3, + "routes/route-0621.tsx": 3, + "routes/route-0632.tsx": 3, + "routes/route-0322.tsx": 3, + "routes/route-0622.tsx": 3, + "routes/route-0567.tsx": 3, + "routes/route-0566.tsx": 3, + "routes/route-0491.tsx": 3, + "routes/route-0616.tsx": 3, + "routes/route-0623.tsx": 3, + "routes/route-0568.tsx": 3, + "routes/route-0633.tsx": 3, + "routes/route-0379.tsx": 3, + "routes/route-0569.tsx": 3, + "routes/route-0492.tsx": 3, + "routes/route-0323.tsx": 3, + "routes/route-0617.tsx": 3, + "routes/route-0624.tsx": 3, + "routes/route-0634.tsx": 3, + "routes/route-0570.tsx": 3, + "routes/route-0493.tsx": 3, + "routes/route-0324.tsx": 3, + "routes/route-0618.tsx": 3, + "routes/route-0646.tsx": 3, + "routes/route-0360.tsx": 3, + "routes/route-0635.tsx": 3, + "routes/route-0571.tsx": 3, + "routes/route-0494.tsx": 3, + "routes/route-0636.tsx": 3, + "routes/route-0647.tsx": 3, + "routes/route-0619.tsx": 3, + "routes/route-0572.tsx": 3, + "routes/route-0620.tsx": 3, + "routes/route-0407.tsx": 3, + "routes/route-0648.tsx": 3, + "routes/route-0573.tsx": 3, + "routes/route-0432.tsx": 3, + "routes/route-0637.tsx": 3, + "routes/route-0504.tsx": 3, + "routes/route-0495.tsx": 3, + "routes/route-0388.tsx": 3, + "routes/route-0649.tsx": 3, + "routes/route-0703.tsx": 3, + "routes/route-0650.tsx": 3, + "routes/route-0505.tsx": 3, + "routes/route-0659.tsx": 3, + "routes/route-0641.tsx": 3, + "routes/route-0682.tsx": 3, + "routes/route-0681.tsx": 3, + "routes/route-0660.tsx": 3, + "routes/route-0638.tsx": 3, + "routes/route-0506.tsx": 3, + "routes/route-0639.tsx": 3, + "routes/route-0683.tsx": 3, + "routes/route-0684.tsx": 3, + "routes/route-0661.tsx": 3, + "routes/route-0640.tsx": 3, + "routes/route-0507.tsx": 3, + "routes/route-0346.tsx": 3, + "routes/route-0685.tsx": 3, + "routes/route-0487.tsx": 3, + "routes/route-0662.tsx": 3, + "routes/route-0508.tsx": 3, + "routes/route-0663.tsx": 3, + "routes/route-0686.tsx": 3, + "routes/route-0510.tsx": 3, + "routes/route-0349.tsx": 3, + "routes/route-0580.tsx": 3, + "routes/route-0664.tsx": 3, + "routes/route-0509.tsx": 3, + "routes/route-0687.tsx": 3, + "routes/route-0511.tsx": 3, + "routes/route-0581.tsx": 3, + "routes/route-0654.tsx": 3, + "routes/route-0665.tsx": 3, + "routes/route-0526.tsx": 3, + "routes/route-0688.tsx": 3, + "routes/route-0652.tsx": 3, + "routes/route-0582.tsx": 3, + "routes/route-0666.tsx": 3, + "routes/route-0514.tsx": 3, + "routes/route-0512.tsx": 3, + "routes/route-0583.tsx": 3, + "routes/route-0689.tsx": 3, + "routes/route-0667.tsx": 3, + "routes/route-0644.tsx": 3, + "routes/route-0690.tsx": 3, + "routes/route-0653.tsx": 3, + "routes/route-0515.tsx": 3, + "routes/route-0668.tsx": 3, + "routes/route-0643.tsx": 3, + "routes/route-0540.tsx": 3, + "routes/route-0516.tsx": 3, + "routes/route-0691.tsx": 3, + "routes/route-0669.tsx": 3, + "routes/route-0527.tsx": 3, + "routes/route-0658.tsx": 3, + "routes/route-0692.tsx": 3, + "routes/route-0517.tsx": 3, + "routes/route-0428.tsx": 3, + "routes/route-0528.tsx": 3, + "routes/route-0670.tsx": 3, + "routes/route-0693.tsx": 3, + "routes/route-0518.tsx": 3, + "routes/route-0704.tsx": 3, + "routes/route-0535.tsx": 3, + "routes/route-0694.tsx": 3, + "routes/route-0671.tsx": 3, + "routes/route-0519.tsx": 3, + "routes/route-0626.tsx": 3, + "routes/route-0534.tsx": 3, + "routes/route-0695.tsx": 3, + "routes/route-0672.tsx": 3, + "routes/route-0705.tsx": 3, + "routes/route-0577.tsx": 3, + "routes/route-0520.tsx": 3, + "routes/route-0536.tsx": 3, + "routes/route-0529.tsx": 3, + "routes/route-0537.tsx": 3, + "routes/route-0600.tsx": 3, + "routes/route-0530.tsx": 3, + "routes/route-0541.tsx": 3, + "routes/route-0538.tsx": 3, + "routes/route-0574.tsx": 3, + "routes/route-0325.tsx": 3, + "routes/route-0542.tsx": 3, + "routes/route-0642.tsx": 3, + "routes/route-0326.tsx": 3, + "routes/route-0496.tsx": 3, + "routes/route-0601.tsx": 3, + "routes/route-0645.tsx": 3, + "routes/route-0539.tsx": 3, + "routes/route-0543.tsx": 3, + "routes/route-0602.tsx": 3, + "routes/route-0327.tsx": 3, + "routes/route-0651.tsx": 3, + "routes/route-0497.tsx": 3, + "routes/route-0498.tsx": 3, + "routes/route-0607.tsx": 3, + "routes/route-0544.tsx": 3, + "routes/route-0499.tsx": 3, + "routes/route-0608.tsx": 3, + "routes/route-0328.tsx": 3, + "routes/route-0603.tsx": 3, + "routes/route-0609.tsx": 3, + "routes/route-0329.tsx": 3, + "routes/route-0675.tsx": 3, + "routes/route-0610.tsx": 3, + "routes/route-0604.tsx": 3, + "routes/route-0655.tsx": 3, + "routes/route-0674.tsx": 3, + "routes/route-0677.tsx": 3, + "routes/route-0611.tsx": 3, + "routes/route-0605.tsx": 3, + "routes/route-0656.tsx": 3, + "routes/route-0330.tsx": 3, + "routes/route-0606.tsx": 3, + "routes/route-0584.tsx": 3, + "routes/route-0433.tsx": 3, + "routes/route-0532.tsx": 3, + "routes/route-0589.tsx": 3, + "routes/route-0523.tsx": 3, + "routes/route-0576.tsx": 3, + "routes/route-0522.tsx": 3, + "routes/route-0586.tsx": 3, + "routes/route-0590.tsx": 3, + "routes/route-0533.tsx": 3, + "routes/route-0676.tsx": 3, + "routes/route-0592.tsx": 3, + "routes/route-0585.tsx": 3, + "routes/route-0575.tsx": 3, + "routes/route-0679.tsx": 3, + "routes/route-0738.tsx": 3, + "routes/route-0696.tsx": 3, + "routes/route-0627.tsx": 3, + "routes/route-0578.tsx": 3, + "routes/route-0678.tsx": 3, + "routes/route-0588.tsx": 3, + "routes/route-0728.tsx": 3, + "routes/route-0525.tsx": 3, + "routes/route-0700.tsx": 3, + "routes/route-0727.tsx": 3, + "routes/route-0729.tsx": 3, + "routes/route-0706.tsx": 3, + "routes/route-0560.tsx": 3, + "routes/route-0625.tsx": 3, + "routes/route-0698.tsx": 3, + "routes/route-0699.tsx": 3, + "routes/route-0730.tsx": 3, + "routes/route-0739.tsx": 3, + "routes/route-0701.tsx": 3, + "routes/route-0734.tsx": 3, + "routes/route-0556.tsx": 3, + "routes/route-0740.tsx": 3, + "routes/route-0707.tsx": 3, + "routes/route-0431.tsx": 3, + "routes/route-0531.tsx": 3, + "routes/route-0500.tsx": 3, + "routes/route-0557.tsx": 3, + "routes/route-0545.tsx": 3, + "routes/route-0741.tsx": 3, + "routes/route-0742.tsx": 3, + "routes/route-0736.tsx": 3, + "routes/route-0559.tsx": 3, + "routes/route-0558.tsx": 3, + "routes/route-0718.tsx": 3, + "routes/route-0550.tsx": 3, + "routes/route-0732.tsx": 3, + "routes/route-0561.tsx": 3, + "routes/route-0612.tsx": 3, + "routes/route-0502.tsx": 3, + "routes/route-0587.tsx": 3, + "routes/route-0719.tsx": 3, + "routes/route-0737.tsx": 3, + "routes/route-0552.tsx": 3, + "routes/route-0551.tsx": 3, + "routes/route-0702.tsx": 3, + "routes/route-0725.tsx": 3, + "routes/route-0723.tsx": 3, + "routes/route-0524.tsx": 3, + "routes/route-0503.tsx": 3, + "routes/route-0733.tsx": 3, + "routes/route-0724.tsx": 3, + "routes/route-0722.tsx": 3, + "routes/route-0721.tsx": 3, + "routes/route-0726.tsx": 3, + "routes/route-0712.tsx": 3, + "routes/route-0709.tsx": 3, + "routes/route-0548.tsx": 3, + "routes/route-0553.tsx": 3, + "routes/route-0710.tsx": 3, + "routes/route-0549.tsx": 3, + "routes/route-0720.tsx": 3, + "routes/route-0715.tsx": 3, + "routes/route-0547.tsx": 3, + "routes/route-0711.tsx": 3, + "routes/route-0708.tsx": 3, + "routes/route-0554.tsx": 3, + "routes/route-0716.tsx": 3, + "routes/route-0714.tsx": 3, + "routes/route-0564.tsx": 3, + "routes/route-0563.tsx": 3, + "routes/route-0746.tsx": 3, + "routes/route-0713.tsx": 3, + "routes/route-0565.tsx": 3, + "routes/route-0747.tsx": 3, + "routes/route-0744.tsx": 3, + "routes/route-0591.tsx": 3, + "routes/route-0748.tsx": 3, + "routes/route-0680.tsx": 3, + "routes/route-0555.tsx": 3, + "routes/route-0521.tsx": 3, + "routes/route-0743.tsx": 3, + "routes/route-0735.tsx": 3, + "routes/route-0717.tsx": 3, + "routes/route-0546.tsx": 3, + "routes/route-0731.tsx": 3, + "routes/route-0501.tsx": 3, + "routes/route-0673.tsx": 3, + "routes/route-0745.tsx": 3, + "routes/route-0562.tsx": 3, + "routes/route-0697.tsx": 3 + }, + "liveCache": { + "entries": 128, + "beforeClear": { + "rss": 748601344, + "heapTotal": 225476608, + "heapUsed": 47268488, + "external": 16415045, + "arrayBuffers": 4905034 + }, + "afterClear": { + "rss": 748617728, + "heapTotal": 184320000, + "heapUsed": 39004784, + "external": 5537022, + "arrayBuffers": 356261 + } + }, + "wallMs": 3196.999208 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-128-timing.json b/benchmarks/compiler/results/final-cache-750-128-timing.json new file mode 100644 index 00000000000..74e60c7ab63 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-128-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:38:48.042Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 128, + "summary": { + "medianBuildMs": 2782.430333, + "medianPeakRssMiB": 1108.75, + "medianWallMs": 3232.070083 + }, + "samples": [ + { + "buildMs": 2782.430333, + "peakRssMiB": 1131.1875, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 145833984, + "heapTotal": 59326464, + "heapUsed": 23218520, + "external": 3979776, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1184841728, + "heapTotal": 314130432, + "heapUsed": 183525504, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1160658944, + "heapTotal": 276054016, + "heapUsed": 57245648, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3232.070083 + }, + { + "buildMs": 2735.325708, + "peakRssMiB": 1108.75, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 139132928, + "heapTotal": 59326464, + "heapUsed": 23215328, + "external": 3979576, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1154039808, + "heapTotal": 303464448, + "heapUsed": 201076304, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1126318080, + "heapTotal": 264781824, + "heapUsed": 57199752, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3202.318333 + }, + { + "buildMs": 2855.951583, + "peakRssMiB": 1096.109375, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 137248768, + "heapTotal": 59064320, + "heapUsed": 23210840, + "external": 3979576, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1149140992, + "heapTotal": 323731456, + "heapUsed": 225658016, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1118715904, + "heapTotal": 266616832, + "heapUsed": 57244208, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3320.295000000001 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-256-profile.json b/benchmarks/compiler/results/final-cache-750-256-profile.json new file mode 100644 index 00000000000..5fc27ea8aa8 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-256-profile.json @@ -0,0 +1,830 @@ +{ + "timestamp": "2026-09-26T14:38:51.282Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 256, + "summary": { + "medianBuildMs": 2743.6742090000002, + "medianPeakRssMiB": 1124.609375, + "medianWallMs": 3189.709042 + }, + "samples": [ + { + "buildMs": 2743.6742090000002, + "peakRssMiB": 1124.609375, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 139231232, + "heapTotal": 59326464, + "heapUsed": 23215072, + "external": 3987968, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1177944064, + "heapTotal": 341688320, + "heapUsed": 221977632, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1138065408, + "heapTotal": 235945984, + "heapUsed": 56265960, + "external": 6950142, + "arrayBuffers": 68485 + }, + "analyzerCalls": 2251, + "analysesByFile": { + "routes/route-0001.tsx": 3, + "routes/__root.tsx": 1, + "routes/route-0003.tsx": 3, + "routes/route-0000.tsx": 3, + "routes/route-0006.tsx": 3, + "routes/route-0002.tsx": 3, + "routes/route-0004.tsx": 3, + "routes/route-0011.tsx": 3, + "routes/route-0007.tsx": 3, + "routes/route-0010.tsx": 3, + "routes/route-0035.tsx": 3, + "routes/route-0008.tsx": 3, + "routes/route-0009.tsx": 3, + "routes/route-0013.tsx": 3, + "routes/route-0005.tsx": 3, + "routes/route-0025.tsx": 3, + "routes/route-0024.tsx": 3, + "routes/route-0026.tsx": 3, + "routes/route-0015.tsx": 3, + "routes/route-0027.tsx": 3, + "routes/route-0016.tsx": 3, + "routes/route-0028.tsx": 3, + "routes/route-0031.tsx": 3, + "routes/route-0014.tsx": 3, + "routes/route-0029.tsx": 3, + "routes/route-0017.tsx": 3, + "routes/route-0032.tsx": 3, + "routes/route-0033.tsx": 3, + "routes/route-0034.tsx": 3, + "routes/route-0030.tsx": 3, + "routes/route-0012.tsx": 3, + "routes/route-0021.tsx": 3, + "routes/route-0051.tsx": 3, + "routes/route-0036.tsx": 3, + "routes/route-0019.tsx": 3, + "routes/route-0020.tsx": 3, + "routes/route-0039.tsx": 3, + "routes/route-0045.tsx": 3, + "routes/route-0037.tsx": 3, + "routes/route-0046.tsx": 3, + "routes/route-0043.tsx": 3, + "routes/route-0063.tsx": 3, + "routes/route-0038.tsx": 3, + "routes/route-0042.tsx": 3, + "routes/route-0047.tsx": 3, + "routes/route-0044.tsx": 3, + "routes/route-0022.tsx": 3, + "routes/route-0023.tsx": 3, + "routes/route-0052.tsx": 3, + "routes/route-0048.tsx": 3, + "routes/route-0050.tsx": 3, + "routes/route-0053.tsx": 3, + "routes/route-0071.tsx": 3, + "routes/route-0067.tsx": 3, + "routes/route-0068.tsx": 3, + "routes/route-0054.tsx": 3, + "routes/route-0064.tsx": 3, + "routes/route-0055.tsx": 3, + "routes/route-0056.tsx": 3, + "routes/route-0070.tsx": 3, + "routes/route-0069.tsx": 3, + "routes/route-0088.tsx": 3, + "routes/route-0018.tsx": 3, + "routes/route-0072.tsx": 3, + "routes/route-0041.tsx": 3, + "routes/route-0073.tsx": 3, + "routes/route-0057.tsx": 3, + "routes/route-0060.tsx": 3, + "routes/route-0084.tsx": 3, + "routes/route-0058.tsx": 3, + "routes/route-0066.tsx": 3, + "routes/route-0080.tsx": 3, + "routes/route-0061.tsx": 3, + "routes/route-0085.tsx": 3, + "routes/route-0059.tsx": 3, + "routes/route-0086.tsx": 3, + "routes/route-0049.tsx": 3, + "routes/route-0081.tsx": 3, + "routes/route-0040.tsx": 3, + "routes/route-0083.tsx": 3, + "routes/route-0082.tsx": 3, + "routes/route-0087.tsx": 3, + "routes/route-0077.tsx": 3, + "routes/route-0075.tsx": 3, + "routes/route-0065.tsx": 3, + "routes/route-0076.tsx": 3, + "routes/route-0062.tsx": 3, + "routes/route-0101.tsx": 3, + "routes/route-0115.tsx": 3, + "routes/route-0079.tsx": 3, + "routes/route-0094.tsx": 3, + "routes/route-0108.tsx": 3, + "routes/route-0104.tsx": 3, + "routes/route-0095.tsx": 3, + "routes/route-0109.tsx": 3, + "routes/route-0105.tsx": 3, + "routes/route-0112.tsx": 3, + "routes/route-0113.tsx": 3, + "routes/route-0089.tsx": 3, + "routes/route-0096.tsx": 3, + "routes/route-0106.tsx": 3, + "routes/route-0090.tsx": 3, + "routes/route-0102.tsx": 3, + "routes/route-0097.tsx": 3, + "routes/route-0114.tsx": 3, + "routes/route-0110.tsx": 3, + "routes/route-0103.tsx": 3, + "routes/route-0107.tsx": 3, + "routes/route-0091.tsx": 3, + "routes/route-0111.tsx": 3, + "routes/route-0128.tsx": 3, + "routes/route-0093.tsx": 3, + "routes/route-0116.tsx": 3, + "routes/route-0135.tsx": 3, + "routes/route-0092.tsx": 3, + "routes/route-0142.tsx": 3, + "routes/route-0117.tsx": 3, + "routes/route-0099.tsx": 3, + "routes/route-0100.tsx": 3, + "routes/route-0125.tsx": 3, + "routes/route-0122.tsx": 3, + "routes/route-0136.tsx": 3, + "routes/route-0119.tsx": 3, + "routes/route-0074.tsx": 3, + "routes/route-0078.tsx": 3, + "routes/route-0124.tsx": 3, + "routes/route-0120.tsx": 3, + "routes/route-0118.tsx": 3, + "routes/route-0127.tsx": 3, + "routes/route-0137.tsx": 3, + "routes/route-0126.tsx": 3, + "routes/route-0121.tsx": 3, + "routes/route-0141.tsx": 3, + "routes/route-0139.tsx": 3, + "routes/route-0140.tsx": 3, + "routes/route-0132.tsx": 3, + "routes/route-0179.tsx": 3, + "routes/route-0130.tsx": 3, + "routes/route-0133.tsx": 3, + "routes/route-0131.tsx": 3, + "routes/route-0190.tsx": 3, + "routes/route-0201.tsx": 3, + "routes/route-0198.tsx": 3, + "routes/route-0199.tsx": 3, + "routes/route-0098.tsx": 3, + "routes/route-0123.tsx": 3, + "routes/route-0196.tsx": 3, + "routes/route-0200.tsx": 3, + "routes/route-0197.tsx": 3, + "routes/route-0180.tsx": 3, + "routes/route-0138.tsx": 3, + "routes/route-0192.tsx": 3, + "routes/route-0181.tsx": 3, + "routes/route-0193.tsx": 3, + "routes/route-0221.tsx": 3, + "routes/route-0161.tsx": 3, + "routes/route-0191.tsx": 3, + "routes/route-0152.tsx": 3, + "routes/route-0194.tsx": 3, + "routes/route-0182.tsx": 3, + "routes/route-0153.tsx": 3, + "routes/route-0202.tsx": 3, + "routes/route-0144.tsx": 3, + "routes/route-0183.tsx": 3, + "routes/route-0203.tsx": 3, + "routes/route-0148.tsx": 3, + "routes/route-0150.tsx": 3, + "routes/route-0154.tsx": 3, + "routes/route-0204.tsx": 3, + "routes/route-0151.tsx": 3, + "routes/route-0205.tsx": 3, + "routes/route-0184.tsx": 3, + "routes/route-0155.tsx": 3, + "routes/route-0149.tsx": 3, + "routes/route-0146.tsx": 3, + "routes/route-0147.tsx": 3, + "routes/route-0185.tsx": 3, + "routes/route-0156.tsx": 3, + "routes/route-0187.tsx": 3, + "routes/route-0143.tsx": 3, + "routes/route-0195.tsx": 3, + "routes/route-0158.tsx": 3, + "routes/route-0134.tsx": 3, + "routes/route-0157.tsx": 3, + "routes/route-0186.tsx": 3, + "routes/route-0188.tsx": 3, + "routes/route-0189.tsx": 3, + "routes/route-0159.tsx": 3, + "routes/route-0162.tsx": 3, + "routes/route-0160.tsx": 3, + "routes/route-0260.tsx": 3, + "routes/route-0217.tsx": 3, + "routes/route-0170.tsx": 3, + "routes/route-0166.tsx": 3, + "routes/route-0171.tsx": 3, + "routes/route-0213.tsx": 3, + "routes/route-0222.tsx": 3, + "routes/route-0214.tsx": 3, + "routes/route-0209.tsx": 3, + "routes/route-0168.tsx": 3, + "routes/route-0163.tsx": 3, + "routes/route-0223.tsx": 3, + "routes/route-0169.tsx": 3, + "routes/route-0164.tsx": 3, + "routes/route-0215.tsx": 3, + "routes/route-0129.tsx": 3, + "routes/route-0224.tsx": 3, + "routes/route-0207.tsx": 3, + "routes/route-0145.tsx": 3, + "routes/route-0225.tsx": 3, + "routes/route-0216.tsx": 3, + "routes/route-0165.tsx": 3, + "routes/route-0211.tsx": 3, + "routes/route-0208.tsx": 3, + "routes/route-0212.tsx": 3, + "routes/route-0167.tsx": 3, + "routes/route-0219.tsx": 3, + "routes/route-0242.tsx": 3, + "routes/route-0298.tsx": 3, + "routes/route-0218.tsx": 3, + "routes/route-0243.tsx": 3, + "routes/route-0288.tsx": 3, + "routes/route-0279.tsx": 3, + "routes/route-0220.tsx": 3, + "routes/route-0233.tsx": 3, + "routes/route-0234.tsx": 3, + "routes/route-0289.tsx": 3, + "routes/route-0261.tsx": 3, + "routes/route-0244.tsx": 3, + "routes/route-0293.tsx": 3, + "routes/route-0229.tsx": 3, + "routes/route-0235.tsx": 3, + "routes/route-0230.tsx": 3, + "routes/route-0294.tsx": 3, + "routes/route-0262.tsx": 3, + "routes/route-0245.tsx": 3, + "routes/route-0290.tsx": 3, + "routes/route-0296.tsx": 3, + "routes/route-0231.tsx": 3, + "routes/route-0236.tsx": 3, + "routes/route-0297.tsx": 3, + "routes/route-0226.tsx": 3, + "routes/route-0246.tsx": 3, + "routes/route-0291.tsx": 3, + "routes/route-0295.tsx": 3, + "routes/route-0206.tsx": 3, + "routes/route-0247.tsx": 3, + "routes/route-0237.tsx": 3, + "routes/route-0232.tsx": 3, + "routes/route-0284.tsx": 3, + "routes/route-0292.tsx": 3, + "routes/route-0239.tsx": 3, + "routes/route-0227.tsx": 3, + "routes/route-0240.tsx": 3, + "routes/route-0281.tsx": 3, + "routes/route-0241.tsx": 3, + "routes/route-0286.tsx": 3, + "routes/route-0238.tsx": 3, + "routes/route-0283.tsx": 3, + "routes/route-0175.tsx": 3, + "routes/route-0228.tsx": 3, + "routes/route-0248.tsx": 3, + "routes/route-0285.tsx": 3, + "routes/route-0173.tsx": 3, + "routes/route-0177.tsx": 3, + "routes/route-0255.tsx": 3, + "routes/route-0287.tsx": 3, + "routes/route-0174.tsx": 3, + "routes/route-0178.tsx": 3, + "routes/route-0256.tsx": 3, + "routes/route-0176.tsx": 3, + "routes/route-0271.tsx": 3, + "routes/route-0353.tsx": 3, + "routes/route-0257.tsx": 3, + "routes/route-0251.tsx": 3, + "routes/route-0268.tsx": 3, + "routes/route-0249.tsx": 3, + "routes/route-0267.tsx": 3, + "routes/route-0258.tsx": 3, + "routes/route-0250.tsx": 3, + "routes/route-0299.tsx": 3, + "routes/route-0269.tsx": 3, + "routes/route-0264.tsx": 3, + "routes/route-0300.tsx": 3, + "routes/route-0270.tsx": 3, + "routes/route-0259.tsx": 3, + "routes/route-0301.tsx": 3, + "routes/route-0265.tsx": 3, + "routes/route-0327.tsx": 3, + "routes/route-0328.tsx": 3, + "routes/route-0266.tsx": 3, + "routes/route-0329.tsx": 3, + "routes/route-0393.tsx": 3, + "routes/route-0307.tsx": 3, + "routes/route-0315.tsx": 3, + "routes/route-0354.tsx": 3, + "routes/route-0252.tsx": 3, + "routes/route-0330.tsx": 3, + "routes/route-0302.tsx": 3, + "routes/route-0316.tsx": 3, + "routes/route-0303.tsx": 3, + "routes/route-0331.tsx": 3, + "routes/route-0275.tsx": 3, + "routes/route-0304.tsx": 3, + "routes/route-0332.tsx": 3, + "routes/route-0317.tsx": 3, + "routes/route-0210.tsx": 3, + "routes/route-0305.tsx": 3, + "routes/route-0333.tsx": 3, + "routes/route-0318.tsx": 3, + "routes/route-0314.tsx": 3, + "routes/route-0172.tsx": 3, + "routes/route-0306.tsx": 3, + "routes/route-0319.tsx": 3, + "routes/route-0272.tsx": 3, + "routes/route-0334.tsx": 3, + "routes/route-0323.tsx": 3, + "routes/route-0274.tsx": 3, + "routes/route-0280.tsx": 3, + "routes/route-0335.tsx": 3, + "routes/route-0320.tsx": 3, + "routes/route-0273.tsx": 3, + "routes/route-0321.tsx": 3, + "routes/route-0322.tsx": 3, + "routes/route-0254.tsx": 3, + "routes/route-0282.tsx": 3, + "routes/route-0336.tsx": 3, + "routes/route-0311.tsx": 3, + "routes/route-0452.tsx": 3, + "routes/route-0337.tsx": 3, + "routes/route-0394.tsx": 3, + "routes/route-0364.tsx": 3, + "routes/route-0310.tsx": 3, + "routes/route-0338.tsx": 3, + "routes/route-0360.tsx": 3, + "routes/route-0355.tsx": 3, + "routes/route-0395.tsx": 3, + "routes/route-0361.tsx": 3, + "routes/route-0375.tsx": 3, + "routes/route-0308.tsx": 3, + "routes/route-0396.tsx": 3, + "routes/route-0362.tsx": 3, + "routes/route-0376.tsx": 3, + "routes/route-0339.tsx": 3, + "routes/route-0425.tsx": 3, + "routes/route-0363.tsx": 3, + "routes/route-0312.tsx": 3, + "routes/route-0424.tsx": 3, + "routes/route-0340.tsx": 3, + "routes/route-0426.tsx": 3, + "routes/route-0313.tsx": 3, + "routes/route-0397.tsx": 3, + "routes/route-0277.tsx": 3, + "routes/route-0503.tsx": 3, + "routes/route-0325.tsx": 3, + "routes/route-0341.tsx": 3, + "routes/route-0427.tsx": 3, + "routes/route-0428.tsx": 3, + "routes/route-0398.tsx": 3, + "routes/route-0324.tsx": 3, + "routes/route-0276.tsx": 3, + "routes/route-0453.tsx": 3, + "routes/route-0357.tsx": 3, + "routes/route-0429.tsx": 3, + "routes/route-0342.tsx": 3, + "routes/route-0356.tsx": 3, + "routes/route-0430.tsx": 3, + "routes/route-0537.tsx": 3, + "routes/route-0326.tsx": 3, + "routes/route-0343.tsx": 3, + "routes/route-0358.tsx": 3, + "routes/route-0263.tsx": 3, + "routes/route-0309.tsx": 3, + "routes/route-0374.tsx": 3, + "routes/route-0521.tsx": 3, + "routes/route-0349.tsx": 3, + "routes/route-0431.tsx": 3, + "routes/route-0530.tsx": 3, + "routes/route-0350.tsx": 3, + "routes/route-0432.tsx": 3, + "routes/route-0278.tsx": 3, + "routes/route-0529.tsx": 3, + "routes/route-0399.tsx": 3, + "routes/route-0433.tsx": 3, + "routes/route-0359.tsx": 3, + "routes/route-0526.tsx": 3, + "routes/route-0533.tsx": 3, + "routes/route-0400.tsx": 3, + "routes/route-0570.tsx": 3, + "routes/route-0351.tsx": 3, + "routes/route-0531.tsx": 3, + "routes/route-0377.tsx": 3, + "routes/route-0352.tsx": 3, + "routes/route-0253.tsx": 3, + "routes/route-0538.tsx": 3, + "routes/route-0378.tsx": 3, + "routes/route-0535.tsx": 3, + "routes/route-0401.tsx": 3, + "routes/route-0385.tsx": 3, + "routes/route-0532.tsx": 3, + "routes/route-0539.tsx": 3, + "routes/route-0386.tsx": 3, + "routes/route-0379.tsx": 3, + "routes/route-0540.tsx": 3, + "routes/route-0387.tsx": 3, + "routes/route-0536.tsx": 3, + "routes/route-0402.tsx": 3, + "routes/route-0388.tsx": 3, + "routes/route-0380.tsx": 3, + "routes/route-0598.tsx": 3, + "routes/route-0382.tsx": 3, + "routes/route-0403.tsx": 3, + "routes/route-0383.tsx": 3, + "routes/route-0541.tsx": 3, + "routes/route-0389.tsx": 3, + "routes/route-0390.tsx": 3, + "routes/route-0542.tsx": 3, + "routes/route-0543.tsx": 3, + "routes/route-0571.tsx": 3, + "routes/route-0572.tsx": 3, + "routes/route-0404.tsx": 3, + "routes/route-0391.tsx": 3, + "routes/route-0544.tsx": 3, + "routes/route-0384.tsx": 3, + "routes/route-0405.tsx": 3, + "routes/route-0573.tsx": 3, + "routes/route-0392.tsx": 3, + "routes/route-0545.tsx": 3, + "routes/route-0564.tsx": 3, + "routes/route-0557.tsx": 3, + "routes/route-0558.tsx": 3, + "routes/route-0406.tsx": 3, + "routes/route-0546.tsx": 3, + "routes/route-0574.tsx": 3, + "routes/route-0559.tsx": 3, + "routes/route-0565.tsx": 3, + "routes/route-0586.tsx": 3, + "routes/route-0547.tsx": 3, + "routes/route-0560.tsx": 3, + "routes/route-0566.tsx": 3, + "routes/route-0561.tsx": 3, + "routes/route-0587.tsx": 3, + "routes/route-0454.tsx": 3, + "routes/route-0348.tsx": 3, + "routes/route-0365.tsx": 3, + "routes/route-0588.tsx": 3, + "routes/route-0520.tsx": 3, + "routes/route-0366.tsx": 3, + "routes/route-0455.tsx": 3, + "routes/route-0504.tsx": 3, + "routes/route-0562.tsx": 3, + "routes/route-0563.tsx": 3, + "routes/route-0589.tsx": 3, + "routes/route-0367.tsx": 3, + "routes/route-0505.tsx": 3, + "routes/route-0534.tsx": 3, + "routes/route-0506.tsx": 3, + "routes/route-0456.tsx": 3, + "routes/route-0368.tsx": 3, + "routes/route-0527.tsx": 3, + "routes/route-0507.tsx": 3, + "routes/route-0525.tsx": 3, + "routes/route-0590.tsx": 3, + "routes/route-0381.tsx": 3, + "routes/route-0369.tsx": 3, + "routes/route-0508.tsx": 3, + "routes/route-0370.tsx": 3, + "routes/route-0528.tsx": 3, + "routes/route-0371.tsx": 3, + "routes/route-0591.tsx": 3, + "routes/route-0509.tsx": 3, + "routes/route-0583.tsx": 3, + "routes/route-0568.tsx": 3, + "routes/route-0581.tsx": 3, + "routes/route-0510.tsx": 3, + "routes/route-0592.tsx": 3, + "routes/route-0575.tsx": 3, + "routes/route-0511.tsx": 3, + "routes/route-0577.tsx": 3, + "routes/route-0512.tsx": 3, + "routes/route-0584.tsx": 3, + "routes/route-0593.tsx": 3, + "routes/route-0576.tsx": 3, + "routes/route-0585.tsx": 3, + "routes/route-0513.tsx": 3, + "routes/route-0749.tsx": 3, + "routes/route-0548.tsx": 3, + "routes/route-0552.tsx": 3, + "routes/route-0674.tsx": 3, + "routes/route-0407.tsx": 3, + "routes/route-0599.tsx": 3, + "routes/route-0514.tsx": 3, + "routes/route-0549.tsx": 3, + "routes/route-0553.tsx": 3, + "routes/route-0515.tsx": 3, + "routes/route-0600.tsx": 3, + "routes/route-0675.tsx": 3, + "routes/route-0554.tsx": 3, + "routes/route-0594.tsx": 3, + "routes/route-0601.tsx": 3, + "routes/route-0567.tsx": 3, + "routes/route-0516.tsx": 3, + "routes/route-0602.tsx": 3, + "routes/route-0555.tsx": 3, + "routes/route-0346.tsx": 3, + "routes/route-0596.tsx": 3, + "routes/route-0677.tsx": 3, + "routes/route-0595.tsx": 3, + "routes/route-0676.tsx": 3, + "routes/route-0517.tsx": 3, + "routes/route-0580.tsx": 3, + "routes/route-0603.tsx": 3, + "routes/route-0518.tsx": 3, + "routes/route-0678.tsx": 3, + "routes/route-0597.tsx": 3, + "routes/route-0457.tsx": 3, + "routes/route-0604.tsx": 3, + "routes/route-0578.tsx": 3, + "routes/route-0519.tsx": 3, + "routes/route-0679.tsx": 3, + "routes/route-0579.tsx": 3, + "routes/route-0458.tsx": 3, + "routes/route-0605.tsx": 3, + "routes/route-0680.tsx": 3, + "routes/route-0347.tsx": 3, + "routes/route-0640.tsx": 3, + "routes/route-0639.tsx": 3, + "routes/route-0434.tsx": 3, + "routes/route-0522.tsx": 3, + "routes/route-0681.tsx": 3, + "routes/route-0459.tsx": 3, + "routes/route-0551.tsx": 3, + "routes/route-0658.tsx": 3, + "routes/route-0606.tsx": 3, + "routes/route-0523.tsx": 3, + "routes/route-0659.tsx": 3, + "routes/route-0682.tsx": 3, + "routes/route-0607.tsx": 3, + "routes/route-0444.tsx": 3, + "routes/route-0683.tsx": 3, + "routes/route-0524.tsx": 3, + "routes/route-0660.tsx": 3, + "routes/route-0460.tsx": 3, + "routes/route-0623.tsx": 3, + "routes/route-0445.tsx": 3, + "routes/route-0446.tsx": 3, + "routes/route-0624.tsx": 3, + "routes/route-0684.tsx": 3, + "routes/route-0667.tsx": 3, + "routes/route-0668.tsx": 3, + "routes/route-0608.tsx": 3, + "routes/route-0461.tsx": 3, + "routes/route-0685.tsx": 3, + "routes/route-0447.tsx": 3, + "routes/route-0625.tsx": 3, + "routes/route-0372.tsx": 3, + "routes/route-0462.tsx": 3, + "routes/route-0686.tsx": 3, + "routes/route-0609.tsx": 3, + "routes/route-0569.tsx": 3, + "routes/route-0463.tsx": 3, + "routes/route-0687.tsx": 3, + "routes/route-0373.tsx": 3, + "routes/route-0450.tsx": 3, + "routes/route-0550.tsx": 3, + "routes/route-0449.tsx": 3, + "routes/route-0688.tsx": 3, + "routes/route-0616.tsx": 3, + "routes/route-0610.tsx": 3, + "routes/route-0719.tsx": 3, + "routes/route-0438.tsx": 3, + "routes/route-0408.tsx": 3, + "routes/route-0464.tsx": 3, + "routes/route-0664.tsx": 3, + "routes/route-0720.tsx": 3, + "routes/route-0435.tsx": 3, + "routes/route-0409.tsx": 3, + "routes/route-0344.tsx": 3, + "routes/route-0617.tsx": 3, + "routes/route-0465.tsx": 3, + "routes/route-0436.tsx": 3, + "routes/route-0556.tsx": 3, + "routes/route-0410.tsx": 3, + "routes/route-0443.tsx": 3, + "routes/route-0618.tsx": 3, + "routes/route-0411.tsx": 3, + "routes/route-0437.tsx": 3, + "routes/route-0466.tsx": 3, + "routes/route-0621.tsx": 3, + "routes/route-0657.tsx": 3, + "routes/route-0703.tsx": 3, + "routes/route-0439.tsx": 3, + "routes/route-0696.tsx": 3, + "routes/route-0412.tsx": 3, + "routes/route-0695.tsx": 3, + "routes/route-0641.tsx": 3, + "routes/route-0467.tsx": 3, + "routes/route-0440.tsx": 3, + "routes/route-0413.tsx": 3, + "routes/route-0697.tsx": 3, + "routes/route-0441.tsx": 3, + "routes/route-0689.tsx": 3, + "routes/route-0698.tsx": 3, + "routes/route-0622.tsx": 3, + "routes/route-0414.tsx": 3, + "routes/route-0642.tsx": 3, + "routes/route-0442.tsx": 3, + "routes/route-0468.tsx": 3, + "routes/route-0699.tsx": 3, + "routes/route-0690.tsx": 3, + "routes/route-0661.tsx": 3, + "routes/route-0415.tsx": 3, + "routes/route-0691.tsx": 3, + "routes/route-0700.tsx": 3, + "routes/route-0665.tsx": 3, + "routes/route-0693.tsx": 3, + "routes/route-0694.tsx": 3, + "routes/route-0666.tsx": 3, + "routes/route-0692.tsx": 3, + "routes/route-0669.tsx": 3, + "routes/route-0632.tsx": 3, + "routes/route-0613.tsx": 3, + "routes/route-0448.tsx": 3, + "routes/route-0626.tsx": 3, + "routes/route-0670.tsx": 3, + "routes/route-0612.tsx": 3, + "routes/route-0627.tsx": 3, + "routes/route-0650.tsx": 3, + "routes/route-0633.tsx": 3, + "routes/route-0644.tsx": 3, + "routes/route-0628.tsx": 3, + "routes/route-0634.tsx": 3, + "routes/route-0451.tsx": 3, + "routes/route-0630.tsx": 3, + "routes/route-0635.tsx": 3, + "routes/route-0629.tsx": 3, + "routes/route-0582.tsx": 3, + "routes/route-0718.tsx": 3, + "routes/route-0636.tsx": 3, + "routes/route-0647.tsx": 3, + "routes/route-0671.tsx": 3, + "routes/route-0615.tsx": 3, + "routes/route-0637.tsx": 3, + "routes/route-0704.tsx": 3, + "routes/route-0614.tsx": 3, + "routes/route-0646.tsx": 3, + "routes/route-0672.tsx": 3, + "routes/route-0638.tsx": 3, + "routes/route-0705.tsx": 3, + "routes/route-0735.tsx": 3, + "routes/route-0673.tsx": 3, + "routes/route-0418.tsx": 3, + "routes/route-0611.tsx": 3, + "routes/route-0417.tsx": 3, + "routes/route-0662.tsx": 3, + "routes/route-0706.tsx": 3, + "routes/route-0486.tsx": 3, + "routes/route-0648.tsx": 3, + "routes/route-0663.tsx": 3, + "routes/route-0649.tsx": 3, + "routes/route-0707.tsx": 3, + "routes/route-0702.tsx": 3, + "routes/route-0619.tsx": 3, + "routes/route-0470.tsx": 3, + "routes/route-0653.tsx": 3, + "routes/route-0494.tsx": 3, + "routes/route-0345.tsx": 3, + "routes/route-0478.tsx": 3, + "routes/route-0651.tsx": 3, + "routes/route-0474.tsx": 3, + "routes/route-0487.tsx": 3, + "routes/route-0479.tsx": 3, + "routes/route-0721.tsx": 3, + "routes/route-0643.tsx": 3, + "routes/route-0480.tsx": 3, + "routes/route-0483.tsx": 3, + "routes/route-0488.tsx": 3, + "routes/route-0471.tsx": 3, + "routes/route-0475.tsx": 3, + "routes/route-0713.tsx": 3, + "routes/route-0489.tsx": 3, + "routes/route-0484.tsx": 3, + "routes/route-0420.tsx": 3, + "routes/route-0654.tsx": 3, + "routes/route-0476.tsx": 3, + "routes/route-0709.tsx": 3, + "routes/route-0485.tsx": 3, + "routes/route-0655.tsx": 3, + "routes/route-0421.tsx": 3, + "routes/route-0419.tsx": 3, + "routes/route-0710.tsx": 3, + "routes/route-0477.tsx": 3, + "routes/route-0472.tsx": 3, + "routes/route-0656.tsx": 3, + "routes/route-0422.tsx": 3, + "routes/route-0481.tsx": 3, + "routes/route-0742.tsx": 3, + "routes/route-0492.tsx": 3, + "routes/route-0711.tsx": 3, + "routes/route-0725.tsx": 3, + "routes/route-0423.tsx": 3, + "routes/route-0473.tsx": 3, + "routes/route-0712.tsx": 3, + "routes/route-0737.tsx": 3, + "routes/route-0728.tsx": 3, + "routes/route-0723.tsx": 3, + "routes/route-0715.tsx": 3, + "routes/route-0498.tsx": 3, + "routes/route-0724.tsx": 3, + "routes/route-0738.tsx": 3, + "routes/route-0726.tsx": 3, + "routes/route-0469.tsx": 3, + "routes/route-0493.tsx": 3, + "routes/route-0495.tsx": 3, + "routes/route-0739.tsx": 3, + "routes/route-0501.tsx": 3, + "routes/route-0714.tsx": 3, + "routes/route-0500.tsx": 3, + "routes/route-0740.tsx": 3, + "routes/route-0727.tsx": 3, + "routes/route-0502.tsx": 3, + "routes/route-0497.tsx": 3, + "routes/route-0716.tsx": 3, + "routes/route-0499.tsx": 3, + "routes/route-0741.tsx": 3, + "routes/route-0717.tsx": 3, + "routes/route-0701.tsx": 3, + "routes/route-0733.tsx": 3, + "routes/route-0729.tsx": 3, + "routes/route-0730.tsx": 3, + "routes/route-0734.tsx": 3, + "routes/route-0731.tsx": 3, + "routes/route-0747.tsx": 3, + "routes/route-0745.tsx": 3, + "routes/route-0732.tsx": 3, + "routes/route-0743.tsx": 3, + "routes/route-0748.tsx": 3, + "routes/route-0746.tsx": 3, + "routes/route-0416.tsx": 3, + "routes/route-0631.tsx": 3, + "routes/route-0744.tsx": 3, + "routes/route-0708.tsx": 3, + "routes/route-0722.tsx": 3, + "routes/route-0482.tsx": 3, + "routes/route-0652.tsx": 3, + "routes/route-0620.tsx": 3, + "routes/route-0490.tsx": 3, + "routes/route-0496.tsx": 3, + "routes/route-0491.tsx": 3, + "routes/route-0645.tsx": 3, + "routes/route-0736.tsx": 3 + }, + "liveCache": { + "entries": 256, + "beforeClear": { + "rss": 737427456, + "heapTotal": 221806592, + "heapUsed": 54486784, + "external": 18043717, + "arrayBuffers": 6540053 + }, + "afterClear": { + "rss": 737067008, + "heapTotal": 192446464, + "heapUsed": 38984472, + "external": 7138558, + "arrayBuffers": 2458277 + } + }, + "wallMs": 3189.709042 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-256-timing.json b/benchmarks/compiler/results/final-cache-750-256-timing.json new file mode 100644 index 00000000000..1dbc59c3f74 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-256-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:39:00.979Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 256, + "summary": { + "medianBuildMs": 2783.735709, + "medianPeakRssMiB": 1136.625, + "medianWallMs": 3228.433417 + }, + "samples": [ + { + "buildMs": 2699.773917, + "peakRssMiB": 1118.953125, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 140017664, + "heapTotal": 59326464, + "heapUsed": 23221048, + "external": 3979776, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1165262848, + "heapTotal": 311345152, + "heapUsed": 201606184, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1137033216, + "heapTotal": 262422528, + "heapUsed": 57191120, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3147.732375 + }, + { + "buildMs": 2808.8353340000003, + "peakRssMiB": 1216.953125, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 142917632, + "heapTotal": 59064320, + "heapUsed": 23218888, + "external": 3987768, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1269760000, + "heapTotal": 354959360, + "heapUsed": 172567576, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1248296960, + "heapTotal": 235159552, + "heapUsed": 57191736, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3268.1910420000004 + }, + { + "buildMs": 2783.735709, + "peakRssMiB": 1136.625, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 139870208, + "heapTotal": 59588608, + "heapUsed": 23219432, + "external": 3979776, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1190543360, + "heapTotal": 311771136, + "heapUsed": 183445960, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1166442496, + "heapTotal": 277364736, + "heapUsed": 57245992, + "external": 6950142, + "arrayBuffers": 68485 + }, + "wallMs": 3228.433417 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-512-profile.json b/benchmarks/compiler/results/final-cache-750-512-profile.json new file mode 100644 index 00000000000..af3fc9a6577 --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-512-profile.json @@ -0,0 +1,830 @@ +{ + "timestamp": "2026-09-26T14:39:04.173Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 1, + "diagnosticOnly": true, + "analysisCacheLimit": 512, + "summary": { + "medianBuildMs": 2664.452875, + "medianPeakRssMiB": 1136.65625, + "medianWallMs": 3138.603833 + }, + "samples": [ + { + "buildMs": 2664.452875, + "peakRssMiB": 1136.65625, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 138510336, + "heapTotal": 59326464, + "heapUsed": 23216256, + "external": 3979776, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1190592512, + "heapTotal": 349716480, + "heapUsed": 244450872, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1160216576, + "heapTotal": 232538112, + "heapUsed": 56165528, + "external": 6950142, + "arrayBuffers": 68485 + }, + "analyzerCalls": 1501, + "analysesByFile": { + "routes/route-0001.tsx": 2, + "routes/route-0004.tsx": 2, + "routes/__root.tsx": 1, + "routes/route-0000.tsx": 2, + "routes/route-0008.tsx": 2, + "routes/route-0005.tsx": 2, + "routes/route-0007.tsx": 2, + "routes/route-0003.tsx": 2, + "routes/route-0021.tsx": 2, + "routes/route-0022.tsx": 2, + "routes/route-0024.tsx": 2, + "routes/route-0023.tsx": 2, + "routes/route-0006.tsx": 2, + "routes/route-0018.tsx": 2, + "routes/route-0002.tsx": 2, + "routes/route-0015.tsx": 2, + "routes/route-0016.tsx": 2, + "routes/route-0019.tsx": 2, + "routes/route-0020.tsx": 2, + "routes/route-0009.tsx": 2, + "routes/route-0040.tsx": 2, + "routes/route-0017.tsx": 2, + "routes/route-0010.tsx": 2, + "routes/route-0046.tsx": 2, + "routes/route-0035.tsx": 2, + "routes/route-0011.tsx": 2, + "routes/route-0036.tsx": 2, + "routes/route-0041.tsx": 2, + "routes/route-0012.tsx": 2, + "routes/route-0042.tsx": 2, + "routes/route-0034.tsx": 2, + "routes/route-0013.tsx": 2, + "routes/route-0038.tsx": 2, + "routes/route-0029.tsx": 2, + "routes/route-0045.tsx": 2, + "routes/route-0037.tsx": 2, + "routes/route-0039.tsx": 2, + "routes/route-0014.tsx": 2, + "routes/route-0026.tsx": 2, + "routes/route-0025.tsx": 2, + "routes/route-0027.tsx": 2, + "routes/route-0043.tsx": 2, + "routes/route-0028.tsx": 2, + "routes/route-0062.tsx": 2, + "routes/route-0057.tsx": 2, + "routes/route-0059.tsx": 2, + "routes/route-0065.tsx": 2, + "routes/route-0047.tsx": 2, + "routes/route-0058.tsx": 2, + "routes/route-0048.tsx": 2, + "routes/route-0068.tsx": 2, + "routes/route-0063.tsx": 2, + "routes/route-0066.tsx": 2, + "routes/route-0049.tsx": 2, + "routes/route-0067.tsx": 2, + "routes/route-0050.tsx": 2, + "routes/route-0051.tsx": 2, + "routes/route-0052.tsx": 2, + "routes/route-0053.tsx": 2, + "routes/route-0055.tsx": 2, + "routes/route-0064.tsx": 2, + "routes/route-0054.tsx": 2, + "routes/route-0061.tsx": 2, + "routes/route-0056.tsx": 2, + "routes/route-0030.tsx": 2, + "routes/route-0109.tsx": 2, + "routes/route-0130.tsx": 2, + "routes/route-0110.tsx": 2, + "routes/route-0069.tsx": 2, + "routes/route-0070.tsx": 2, + "routes/route-0071.tsx": 2, + "routes/route-0032.tsx": 2, + "routes/route-0111.tsx": 2, + "routes/route-0072.tsx": 2, + "routes/route-0112.tsx": 2, + "routes/route-0031.tsx": 2, + "routes/route-0122.tsx": 2, + "routes/route-0074.tsx": 2, + "routes/route-0123.tsx": 2, + "routes/route-0116.tsx": 2, + "routes/route-0075.tsx": 2, + "routes/route-0153.tsx": 2, + "routes/route-0131.tsx": 2, + "routes/route-0077.tsx": 2, + "routes/route-0118.tsx": 2, + "routes/route-0121.tsx": 2, + "routes/route-0073.tsx": 2, + "routes/route-0117.tsx": 2, + "routes/route-0132.tsx": 2, + "routes/route-0119.tsx": 2, + "routes/route-0078.tsx": 2, + "routes/route-0113.tsx": 2, + "routes/route-0114.tsx": 2, + "routes/route-0133.tsx": 2, + "routes/route-0044.tsx": 2, + "routes/route-0076.tsx": 2, + "routes/route-0079.tsx": 2, + "routes/route-0094.tsx": 2, + "routes/route-0128.tsx": 2, + "routes/route-0033.tsx": 2, + "routes/route-0087.tsx": 2, + "routes/route-0090.tsx": 2, + "routes/route-0080.tsx": 2, + "routes/route-0120.tsx": 2, + "routes/route-0129.tsx": 2, + "routes/route-0088.tsx": 2, + "routes/route-0084.tsx": 2, + "routes/route-0091.tsx": 2, + "routes/route-0095.tsx": 2, + "routes/route-0124.tsx": 2, + "routes/route-0103.tsx": 2, + "routes/route-0083.tsx": 2, + "routes/route-0102.tsx": 2, + "routes/route-0092.tsx": 2, + "routes/route-0086.tsx": 2, + "routes/route-0104.tsx": 2, + "routes/route-0089.tsx": 2, + "routes/route-0093.tsx": 2, + "routes/route-0134.tsx": 2, + "routes/route-0105.tsx": 2, + "routes/route-0081.tsx": 2, + "routes/route-0096.tsx": 2, + "routes/route-0143.tsx": 2, + "routes/route-0106.tsx": 2, + "routes/route-0127.tsx": 2, + "routes/route-0101.tsx": 2, + "routes/route-0115.tsx": 2, + "routes/route-0100.tsx": 2, + "routes/route-0135.tsx": 2, + "routes/route-0082.tsx": 2, + "routes/route-0107.tsx": 2, + "routes/route-0177.tsx": 2, + "routes/route-0136.tsx": 2, + "routes/route-0097.tsx": 2, + "routes/route-0108.tsx": 2, + "routes/route-0189.tsx": 2, + "routes/route-0137.tsx": 2, + "routes/route-0138.tsx": 2, + "routes/route-0154.tsx": 2, + "routes/route-0139.tsx": 2, + "routes/route-0155.tsx": 2, + "routes/route-0183.tsx": 2, + "routes/route-0179.tsx": 2, + "routes/route-0140.tsx": 2, + "routes/route-0184.tsx": 2, + "routes/route-0178.tsx": 2, + "routes/route-0201.tsx": 2, + "routes/route-0180.tsx": 2, + "routes/route-0141.tsx": 2, + "routes/route-0185.tsx": 2, + "routes/route-0190.tsx": 2, + "routes/route-0060.tsx": 2, + "routes/route-0191.tsx": 2, + "routes/route-0126.tsx": 2, + "routes/route-0142.tsx": 2, + "routes/route-0098.tsx": 2, + "routes/route-0199.tsx": 2, + "routes/route-0196.tsx": 2, + "routes/route-0198.tsx": 2, + "routes/route-0182.tsx": 2, + "routes/route-0197.tsx": 2, + "routes/route-0186.tsx": 2, + "routes/route-0200.tsx": 2, + "routes/route-0192.tsx": 2, + "routes/route-0187.tsx": 2, + "routes/route-0231.tsx": 2, + "routes/route-0261.tsx": 2, + "routes/route-0193.tsx": 2, + "routes/route-0144.tsx": 2, + "routes/route-0202.tsx": 2, + "routes/route-0246.tsx": 2, + "routes/route-0149.tsx": 2, + "routes/route-0148.tsx": 2, + "routes/route-0203.tsx": 2, + "routes/route-0099.tsx": 2, + "routes/route-0232.tsx": 2, + "routes/route-0247.tsx": 2, + "routes/route-0194.tsx": 2, + "routes/route-0150.tsx": 2, + "routes/route-0145.tsx": 2, + "routes/route-0204.tsx": 2, + "routes/route-0248.tsx": 2, + "routes/route-0217.tsx": 2, + "routes/route-0233.tsx": 2, + "routes/route-0195.tsx": 2, + "routes/route-0146.tsx": 2, + "routes/route-0125.tsx": 2, + "routes/route-0156.tsx": 2, + "routes/route-0151.tsx": 2, + "routes/route-0234.tsx": 2, + "routes/route-0249.tsx": 2, + "routes/route-0152.tsx": 2, + "routes/route-0147.tsx": 2, + "routes/route-0224.tsx": 2, + "routes/route-0167.tsx": 2, + "routes/route-0166.tsx": 2, + "routes/route-0250.tsx": 2, + "routes/route-0219.tsx": 2, + "routes/route-0168.tsx": 2, + "routes/route-0255.tsx": 2, + "routes/route-0235.tsx": 2, + "routes/route-0256.tsx": 2, + "routes/route-0169.tsx": 2, + "routes/route-0181.tsx": 2, + "routes/route-0251.tsx": 2, + "routes/route-0257.tsx": 2, + "routes/route-0220.tsx": 2, + "routes/route-0252.tsx": 2, + "routes/route-0221.tsx": 2, + "routes/route-0236.tsx": 2, + "routes/route-0253.tsx": 2, + "routes/route-0222.tsx": 2, + "routes/route-0258.tsx": 2, + "routes/route-0223.tsx": 2, + "routes/route-0254.tsx": 2, + "routes/route-0227.tsx": 2, + "routes/route-0229.tsx": 2, + "routes/route-0237.tsx": 2, + "routes/route-0259.tsx": 2, + "routes/route-0225.tsx": 2, + "routes/route-0228.tsx": 2, + "routes/route-0260.tsx": 2, + "routes/route-0226.tsx": 2, + "routes/route-0238.tsx": 2, + "routes/route-0230.tsx": 2, + "routes/route-0214.tsx": 2, + "routes/route-0211.tsx": 2, + "routes/route-0215.tsx": 2, + "routes/route-0206.tsx": 2, + "routes/route-0212.tsx": 2, + "routes/route-0239.tsx": 2, + "routes/route-0213.tsx": 2, + "routes/route-0207.tsx": 2, + "routes/route-0208.tsx": 2, + "routes/route-0240.tsx": 2, + "routes/route-0243.tsx": 2, + "routes/route-0161.tsx": 2, + "routes/route-0209.tsx": 2, + "routes/route-0158.tsx": 2, + "routes/route-0210.tsx": 2, + "routes/route-0241.tsx": 2, + "routes/route-0244.tsx": 2, + "routes/route-0242.tsx": 2, + "routes/route-0367.tsx": 2, + "routes/route-0245.tsx": 2, + "routes/route-0163.tsx": 2, + "routes/route-0216.tsx": 2, + "routes/route-0262.tsx": 2, + "routes/route-0162.tsx": 2, + "routes/route-0159.tsx": 2, + "routes/route-0263.tsx": 2, + "routes/route-0160.tsx": 2, + "routes/route-0264.tsx": 2, + "routes/route-0448.tsx": 2, + "routes/route-0432.tsx": 2, + "routes/route-0265.tsx": 2, + "routes/route-0465.tsx": 2, + "routes/route-0399.tsx": 2, + "routes/route-0433.tsx": 2, + "routes/route-0266.tsx": 2, + "routes/route-0434.tsx": 2, + "routes/route-0400.tsx": 2, + "routes/route-0368.tsx": 2, + "routes/route-0267.tsx": 2, + "routes/route-0435.tsx": 2, + "routes/route-0449.tsx": 2, + "routes/route-0085.tsx": 2, + "routes/route-0401.tsx": 2, + "routes/route-0268.tsx": 2, + "routes/route-0436.tsx": 2, + "routes/route-0269.tsx": 2, + "routes/route-0402.tsx": 2, + "routes/route-0437.tsx": 2, + "routes/route-0450.tsx": 2, + "routes/route-0270.tsx": 2, + "routes/route-0438.tsx": 2, + "routes/route-0271.tsx": 2, + "routes/route-0403.tsx": 2, + "routes/route-0451.tsx": 2, + "routes/route-0443.tsx": 2, + "routes/route-0404.tsx": 2, + "routes/route-0439.tsx": 2, + "routes/route-0272.tsx": 2, + "routes/route-0452.tsx": 2, + "routes/route-0405.tsx": 2, + "routes/route-0273.tsx": 2, + "routes/route-0453.tsx": 2, + "routes/route-0440.tsx": 2, + "routes/route-0274.tsx": 2, + "routes/route-0441.tsx": 2, + "routes/route-0173.tsx": 2, + "routes/route-0406.tsx": 2, + "routes/route-0171.tsx": 2, + "routes/route-0454.tsx": 2, + "routes/route-0275.tsx": 2, + "routes/route-0442.tsx": 2, + "routes/route-0419.tsx": 2, + "routes/route-0172.tsx": 2, + "routes/route-0276.tsx": 2, + "routes/route-0407.tsx": 2, + "routes/route-0455.tsx": 2, + "routes/route-0425.tsx": 2, + "routes/route-0408.tsx": 2, + "routes/route-0456.tsx": 2, + "routes/route-0277.tsx": 2, + "routes/route-0426.tsx": 2, + "routes/route-0420.tsx": 2, + "routes/route-0188.tsx": 2, + "routes/route-0205.tsx": 2, + "routes/route-0218.tsx": 2, + "routes/route-0427.tsx": 2, + "routes/route-0457.tsx": 2, + "routes/route-0429.tsx": 2, + "routes/route-0421.tsx": 2, + "routes/route-0422.tsx": 2, + "routes/route-0461.tsx": 2, + "routes/route-0430.tsx": 2, + "routes/route-0459.tsx": 2, + "routes/route-0423.tsx": 2, + "routes/route-0431.tsx": 2, + "routes/route-0458.tsx": 2, + "routes/route-0460.tsx": 2, + "routes/route-0322.tsx": 2, + "routes/route-0414.tsx": 2, + "routes/route-0280.tsx": 2, + "routes/route-0279.tsx": 2, + "routes/route-0410.tsx": 2, + "routes/route-0281.tsx": 2, + "routes/route-0170.tsx": 2, + "routes/route-0462.tsx": 2, + "routes/route-0463.tsx": 2, + "routes/route-0282.tsx": 2, + "routes/route-0283.tsx": 2, + "routes/route-0174.tsx": 2, + "routes/route-0284.tsx": 2, + "routes/route-0464.tsx": 2, + "routes/route-0175.tsx": 2, + "routes/route-0286.tsx": 2, + "routes/route-0176.tsx": 2, + "routes/route-0285.tsx": 2, + "routes/route-0580.tsx": 2, + "routes/route-0416.tsx": 2, + "routes/route-0466.tsx": 2, + "routes/route-0642.tsx": 2, + "routes/route-0415.tsx": 2, + "routes/route-0581.tsx": 2, + "routes/route-0467.tsx": 2, + "routes/route-0582.tsx": 2, + "routes/route-0468.tsx": 2, + "routes/route-0417.tsx": 2, + "routes/route-0469.tsx": 2, + "routes/route-0369.tsx": 2, + "routes/route-0470.tsx": 2, + "routes/route-0418.tsx": 2, + "routes/route-0583.tsx": 2, + "routes/route-0584.tsx": 2, + "routes/route-0471.tsx": 2, + "routes/route-0370.tsx": 2, + "routes/route-0585.tsx": 2, + "routes/route-0472.tsx": 2, + "routes/route-0371.tsx": 2, + "routes/route-0444.tsx": 2, + "routes/route-0749.tsx": 2, + "routes/route-0586.tsx": 2, + "routes/route-0164.tsx": 2, + "routes/route-0473.tsx": 2, + "routes/route-0587.tsx": 2, + "routes/route-0409.tsx": 2, + "routes/route-0445.tsx": 2, + "routes/route-0588.tsx": 2, + "routes/route-0474.tsx": 2, + "routes/route-0278.tsx": 2, + "routes/route-0475.tsx": 2, + "routes/route-0323.tsx": 2, + "routes/route-0589.tsx": 2, + "routes/route-0165.tsx": 2, + "routes/route-0476.tsx": 2, + "routes/route-0446.tsx": 2, + "routes/route-0590.tsx": 2, + "routes/route-0324.tsx": 2, + "routes/route-0477.tsx": 2, + "routes/route-0528.tsx": 2, + "routes/route-0591.tsx": 2, + "routes/route-0447.tsx": 2, + "routes/route-0346.tsx": 2, + "routes/route-0529.tsx": 2, + "routes/route-0592.tsx": 2, + "routes/route-0478.tsx": 2, + "routes/route-0530.tsx": 2, + "routes/route-0347.tsx": 2, + "routes/route-0334.tsx": 2, + "routes/route-0348.tsx": 2, + "routes/route-0479.tsx": 2, + "routes/route-0593.tsx": 2, + "routes/route-0480.tsx": 2, + "routes/route-0531.tsx": 2, + "routes/route-0345.tsx": 2, + "routes/route-0594.tsx": 2, + "routes/route-0349.tsx": 2, + "routes/route-0532.tsx": 2, + "routes/route-0481.tsx": 2, + "routes/route-0350.tsx": 2, + "routes/route-0595.tsx": 2, + "routes/route-0533.tsx": 2, + "routes/route-0325.tsx": 2, + "routes/route-0482.tsx": 2, + "routes/route-0351.tsx": 2, + "routes/route-0596.tsx": 2, + "routes/route-0534.tsx": 2, + "routes/route-0483.tsx": 2, + "routes/route-0597.tsx": 2, + "routes/route-0352.tsx": 2, + "routes/route-0484.tsx": 2, + "routes/route-0535.tsx": 2, + "routes/route-0326.tsx": 2, + "routes/route-0536.tsx": 2, + "routes/route-0335.tsx": 2, + "routes/route-0327.tsx": 2, + "routes/route-0428.tsx": 2, + "routes/route-0599.tsx": 2, + "routes/route-0598.tsx": 2, + "routes/route-0336.tsx": 2, + "routes/route-0506.tsx": 2, + "routes/route-0424.tsx": 2, + "routes/route-0537.tsx": 2, + "routes/route-0600.tsx": 2, + "routes/route-0328.tsx": 2, + "routes/route-0337.tsx": 2, + "routes/route-0601.tsx": 2, + "routes/route-0496.tsx": 2, + "routes/route-0538.tsx": 2, + "routes/route-0329.tsx": 2, + "routes/route-0539.tsx": 2, + "routes/route-0497.tsx": 2, + "routes/route-0517.tsx": 2, + "routes/route-0540.tsx": 2, + "routes/route-0157.tsx": 2, + "routes/route-0495.tsx": 2, + "routes/route-0498.tsx": 2, + "routes/route-0411.tsx": 2, + "routes/route-0372.tsx": 2, + "routes/route-0330.tsx": 2, + "routes/route-0507.tsx": 2, + "routes/route-0499.tsx": 2, + "routes/route-0412.tsx": 2, + "routes/route-0331.tsx": 2, + "routes/route-0373.tsx": 2, + "routes/route-0413.tsx": 2, + "routes/route-0508.tsx": 2, + "routes/route-0374.tsx": 2, + "routes/route-0500.tsx": 2, + "routes/route-0375.tsx": 2, + "routes/route-0501.tsx": 2, + "routes/route-0376.tsx": 2, + "routes/route-0509.tsx": 2, + "routes/route-0513.tsx": 2, + "routes/route-0502.tsx": 2, + "routes/route-0514.tsx": 2, + "routes/route-0643.tsx": 2, + "routes/route-0304.tsx": 2, + "routes/route-0377.tsx": 2, + "routes/route-0503.tsx": 2, + "routes/route-0510.tsx": 2, + "routes/route-0486.tsx": 2, + "routes/route-0515.tsx": 2, + "routes/route-0288.tsx": 2, + "routes/route-0378.tsx": 2, + "routes/route-0504.tsx": 2, + "routes/route-0289.tsx": 2, + "routes/route-0516.tsx": 2, + "routes/route-0487.tsx": 2, + "routes/route-0505.tsx": 2, + "routes/route-0379.tsx": 2, + "routes/route-0380.tsx": 2, + "routes/route-0341.tsx": 2, + "routes/route-0290.tsx": 2, + "routes/route-0522.tsx": 2, + "routes/route-0488.tsx": 2, + "routes/route-0297.tsx": 2, + "routes/route-0381.tsx": 2, + "routes/route-0291.tsx": 2, + "routes/route-0489.tsx": 2, + "routes/route-0298.tsx": 2, + "routes/route-0339.tsx": 2, + "routes/route-0382.tsx": 2, + "routes/route-0343.tsx": 2, + "routes/route-0340.tsx": 2, + "routes/route-0292.tsx": 2, + "routes/route-0644.tsx": 2, + "routes/route-0299.tsx": 2, + "routes/route-0342.tsx": 2, + "routes/route-0518.tsx": 2, + "routes/route-0485.tsx": 2, + "routes/route-0293.tsx": 2, + "routes/route-0300.tsx": 2, + "routes/route-0295.tsx": 2, + "routes/route-0645.tsx": 2, + "routes/route-0353.tsx": 2, + "routes/route-0296.tsx": 2, + "routes/route-0519.tsx": 2, + "routes/route-0490.tsx": 2, + "routes/route-0523.tsx": 2, + "routes/route-0354.tsx": 2, + "routes/route-0301.tsx": 2, + "routes/route-0520.tsx": 2, + "routes/route-0294.tsx": 2, + "routes/route-0526.tsx": 2, + "routes/route-0525.tsx": 2, + "routes/route-0646.tsx": 2, + "routes/route-0355.tsx": 2, + "routes/route-0491.tsx": 2, + "routes/route-0524.tsx": 2, + "routes/route-0302.tsx": 2, + "routes/route-0647.tsx": 2, + "routes/route-0492.tsx": 2, + "routes/route-0313.tsx": 2, + "routes/route-0527.tsx": 2, + "routes/route-0622.tsx": 2, + "routes/route-0338.tsx": 2, + "routes/route-0602.tsx": 2, + "routes/route-0356.tsx": 2, + "routes/route-0493.tsx": 2, + "routes/route-0603.tsx": 2, + "routes/route-0344.tsx": 2, + "routes/route-0303.tsx": 2, + "routes/route-0308.tsx": 2, + "routes/route-0357.tsx": 2, + "routes/route-0623.tsx": 2, + "routes/route-0648.tsx": 2, + "routes/route-0309.tsx": 2, + "routes/route-0305.tsx": 2, + "routes/route-0604.tsx": 2, + "routes/route-0358.tsx": 2, + "routes/route-0624.tsx": 2, + "routes/route-0306.tsx": 2, + "routes/route-0494.tsx": 2, + "routes/route-0310.tsx": 2, + "routes/route-0649.tsx": 2, + "routes/route-0359.tsx": 2, + "routes/route-0633.tsx": 2, + "routes/route-0605.tsx": 2, + "routes/route-0307.tsx": 2, + "routes/route-0287.tsx": 2, + "routes/route-0699.tsx": 2, + "routes/route-0650.tsx": 2, + "routes/route-0360.tsx": 2, + "routes/route-0560.tsx": 2, + "routes/route-0606.tsx": 2, + "routes/route-0625.tsx": 2, + "routes/route-0311.tsx": 2, + "routes/route-0512.tsx": 2, + "routes/route-0314.tsx": 2, + "routes/route-0361.tsx": 2, + "routes/route-0700.tsx": 2, + "routes/route-0607.tsx": 2, + "routes/route-0315.tsx": 2, + "routes/route-0312.tsx": 2, + "routes/route-0626.tsx": 2, + "routes/route-0362.tsx": 2, + "routes/route-0651.tsx": 2, + "routes/route-0542.tsx": 2, + "routes/route-0363.tsx": 2, + "routes/route-0608.tsx": 2, + "routes/route-0627.tsx": 2, + "routes/route-0543.tsx": 2, + "routes/route-0609.tsx": 2, + "routes/route-0544.tsx": 2, + "routes/route-0318.tsx": 2, + "routes/route-0541.tsx": 2, + "routes/route-0511.tsx": 2, + "routes/route-0332.tsx": 2, + "routes/route-0316.tsx": 2, + "routes/route-0610.tsx": 2, + "routes/route-0545.tsx": 2, + "routes/route-0561.tsx": 2, + "routes/route-0552.tsx": 2, + "routes/route-0317.tsx": 2, + "routes/route-0562.tsx": 2, + "routes/route-0611.tsx": 2, + "routes/route-0333.tsx": 2, + "routes/route-0553.tsx": 2, + "routes/route-0612.tsx": 2, + "routes/route-0556.tsx": 2, + "routes/route-0546.tsx": 2, + "routes/route-0563.tsx": 2, + "routes/route-0613.tsx": 2, + "routes/route-0725.tsx": 2, + "routes/route-0737.tsx": 2, + "routes/route-0557.tsx": 2, + "routes/route-0702.tsx": 2, + "routes/route-0564.tsx": 2, + "routes/route-0726.tsx": 2, + "routes/route-0383.tsx": 2, + "routes/route-0558.tsx": 2, + "routes/route-0614.tsx": 2, + "routes/route-0703.tsx": 2, + "routes/route-0559.tsx": 2, + "routes/route-0320.tsx": 2, + "routes/route-0615.tsx": 2, + "routes/route-0521.tsx": 2, + "routes/route-0319.tsx": 2, + "routes/route-0704.tsx": 2, + "routes/route-0676.tsx": 2, + "routes/route-0630.tsx": 2, + "routes/route-0616.tsx": 2, + "routes/route-0321.tsx": 2, + "routes/route-0677.tsx": 2, + "routes/route-0617.tsx": 2, + "routes/route-0705.tsx": 2, + "routes/route-0631.tsx": 2, + "routes/route-0555.tsx": 2, + "routes/route-0663.tsx": 2, + "routes/route-0629.tsx": 2, + "routes/route-0618.tsx": 2, + "routes/route-0706.tsx": 2, + "routes/route-0652.tsx": 2, + "routes/route-0678.tsx": 2, + "routes/route-0619.tsx": 2, + "routes/route-0549.tsx": 2, + "routes/route-0632.tsx": 2, + "routes/route-0657.tsx": 2, + "routes/route-0658.tsx": 2, + "routes/route-0679.tsx": 2, + "routes/route-0620.tsx": 2, + "routes/route-0707.tsx": 2, + "routes/route-0572.tsx": 2, + "routes/route-0653.tsx": 2, + "routes/route-0621.tsx": 2, + "routes/route-0548.tsx": 2, + "routes/route-0708.tsx": 2, + "routes/route-0659.tsx": 2, + "routes/route-0660.tsx": 2, + "routes/route-0654.tsx": 2, + "routes/route-0661.tsx": 2, + "routes/route-0675.tsx": 2, + "routes/route-0709.tsx": 2, + "routes/route-0680.tsx": 2, + "routes/route-0689.tsx": 2, + "routes/route-0717.tsx": 2, + "routes/route-0662.tsx": 2, + "routes/route-0710.tsx": 2, + "routes/route-0690.tsx": 2, + "routes/route-0569.tsx": 2, + "routes/route-0681.tsx": 2, + "routes/route-0664.tsx": 2, + "routes/route-0655.tsx": 2, + "routes/route-0682.tsx": 2, + "routes/route-0711.tsx": 2, + "routes/route-0567.tsx": 2, + "routes/route-0656.tsx": 2, + "routes/route-0683.tsx": 2, + "routes/route-0665.tsx": 2, + "routes/route-0568.tsx": 2, + "routes/route-0365.tsx": 2, + "routes/route-0684.tsx": 2, + "routes/route-0666.tsx": 2, + "routes/route-0691.tsx": 2, + "routes/route-0685.tsx": 2, + "routes/route-0670.tsx": 2, + "routes/route-0570.tsx": 2, + "routes/route-0686.tsx": 2, + "routes/route-0712.tsx": 2, + "routes/route-0743.tsx": 2, + "routes/route-0671.tsx": 2, + "routes/route-0687.tsx": 2, + "routes/route-0713.tsx": 2, + "routes/route-0692.tsx": 2, + "routes/route-0672.tsx": 2, + "routes/route-0738.tsx": 2, + "routes/route-0688.tsx": 2, + "routes/route-0693.tsx": 2, + "routes/route-0718.tsx": 2, + "routes/route-0714.tsx": 2, + "routes/route-0739.tsx": 2, + "routes/route-0719.tsx": 2, + "routes/route-0722.tsx": 2, + "routes/route-0668.tsx": 2, + "routes/route-0723.tsx": 2, + "routes/route-0715.tsx": 2, + "routes/route-0694.tsx": 2, + "routes/route-0720.tsx": 2, + "routes/route-0724.tsx": 2, + "routes/route-0701.tsx": 2, + "routes/route-0695.tsx": 2, + "routes/route-0721.tsx": 2, + "routes/route-0716.tsx": 2, + "routes/route-0744.tsx": 2, + "routes/route-0364.tsx": 2, + "routes/route-0732.tsx": 2, + "routes/route-0697.tsx": 2, + "routes/route-0696.tsx": 2, + "routes/route-0745.tsx": 2, + "routes/route-0730.tsx": 2, + "routes/route-0734.tsx": 2, + "routes/route-0366.tsx": 2, + "routes/route-0731.tsx": 2, + "routes/route-0550.tsx": 2, + "routes/route-0746.tsx": 2, + "routes/route-0733.tsx": 2, + "routes/route-0698.tsx": 2, + "routes/route-0747.tsx": 2, + "routes/route-0669.tsx": 2, + "routes/route-0728.tsx": 2, + "routes/route-0391.tsx": 2, + "routes/route-0729.tsx": 2, + "routes/route-0576.tsx": 2, + "routes/route-0638.tsx": 2, + "routes/route-0748.tsx": 2, + "routes/route-0741.tsx": 2, + "routes/route-0385.tsx": 2, + "routes/route-0571.tsx": 2, + "routes/route-0635.tsx": 2, + "routes/route-0674.tsx": 2, + "routes/route-0735.tsx": 2, + "routes/route-0551.tsx": 2, + "routes/route-0554.tsx": 2, + "routes/route-0547.tsx": 2, + "routes/route-0386.tsx": 2, + "routes/route-0636.tsx": 2, + "routes/route-0640.tsx": 2, + "routes/route-0637.tsx": 2, + "routes/route-0639.tsx": 2, + "routes/route-0736.tsx": 2, + "routes/route-0574.tsx": 2, + "routes/route-0388.tsx": 2, + "routes/route-0387.tsx": 2, + "routes/route-0395.tsx": 2, + "routes/route-0390.tsx": 2, + "routes/route-0389.tsx": 2, + "routes/route-0394.tsx": 2, + "routes/route-0393.tsx": 2, + "routes/route-0575.tsx": 2, + "routes/route-0641.tsx": 2, + "routes/route-0384.tsx": 2, + "routes/route-0398.tsx": 2, + "routes/route-0727.tsx": 2, + "routes/route-0396.tsx": 2, + "routes/route-0565.tsx": 2, + "routes/route-0634.tsx": 2, + "routes/route-0566.tsx": 2, + "routes/route-0579.tsx": 2, + "routes/route-0667.tsx": 2, + "routes/route-0740.tsx": 2, + "routes/route-0573.tsx": 2, + "routes/route-0673.tsx": 2, + "routes/route-0742.tsx": 2, + "routes/route-0392.tsx": 2, + "routes/route-0397.tsx": 2, + "routes/route-0628.tsx": 2, + "routes/route-0578.tsx": 2, + "routes/route-0577.tsx": 2 + }, + "liveCache": { + "entries": 512, + "beforeClear": { + "rss": 764166144, + "heapTotal": 270827520, + "heapUsed": 68839528, + "external": 22705950, + "arrayBuffers": 6474629 + }, + "afterClear": { + "rss": 763396096, + "heapTotal": 199786496, + "heapUsed": 38870704, + "external": 10341630, + "arrayBuffers": 5523717 + } + }, + "wallMs": 3138.603833 + } + ] +} diff --git a/benchmarks/compiler/results/final-cache-750-512-timing.json b/benchmarks/compiler/results/final-cache-750-512-timing.json new file mode 100644 index 00000000000..8c235b367ab --- /dev/null +++ b/benchmarks/compiler/results/final-cache-750-512-timing.json @@ -0,0 +1,117 @@ +{ + "timestamp": "2026-09-26T14:39:13.701Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "cpu": "Apple M3 Max", + "routes": 750, + "repetitions": 3, + "diagnosticOnly": false, + "analysisCacheLimit": 512, + "summary": { + "medianBuildMs": 2689.4981669999997, + "medianPeakRssMiB": 1153.03125, + "medianWallMs": 3163.621208 + }, + "samples": [ + { + "buildMs": 2689.4981669999997, + "peakRssMiB": 1146.25, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 138461184, + "heapTotal": 59326464, + "heapUsed": 23220048, + "external": 3987968, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1200947200, + "heapTotal": 368803840, + "heapUsed": 267464040, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1169588224, + "heapTotal": 247742464, + "heapUsed": 55654944, + "external": 6944921, + "arrayBuffers": 68485 + }, + "wallMs": 3163.621208 + }, + { + "buildMs": 2695.580333, + "peakRssMiB": 1153.03125, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 139214848, + "heapTotal": 59326464, + "heapUsed": 23219136, + "external": 3979576, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1208123392, + "heapTotal": 368836608, + "heapUsed": 268451792, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1176944640, + "heapTotal": 248791040, + "heapUsed": 55652664, + "external": 6944921, + "arrayBuffers": 68485 + }, + "wallMs": 3184.2321250000005 + }, + { + "buildMs": 2647.87875, + "peakRssMiB": 1155.421875, + "sourceHash": "644731e732e90294372c00d2d34047c19766a1fd20b26c669ea83fb0d7ad5e22", + "chunks": 2251, + "emittedJsBytes": 1641651, + "before": { + "rss": 140328960, + "heapTotal": 59326464, + "heapUsed": 23221576, + "external": 3987768, + "arrayBuffers": 44335 + }, + "after": { + "rss": 1210580992, + "heapTotal": 368017408, + "heapUsed": 267324120, + "external": 6966526, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 1179353088, + "heapTotal": 251936768, + "heapUsed": 55635824, + "external": 6944921, + "arrayBuffers": 68485 + }, + "wallMs": 3129.3204590000005 + } + ] +} diff --git a/benchmarks/compiler/results/final-hydrate-client-baseline.json b/benchmarks/compiler/results/final-hydrate-client-baseline.json new file mode 100644 index 00000000000..d740ae8ee0c --- /dev/null +++ b/benchmarks/compiler/results/final-hydrate-client-baseline.json @@ -0,0 +1,171 @@ +{ + "timestamp": "2026-09-26T14:40:15.096Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 19.946639000000005, + "medianPeakRssMiB": 125.84375 + }, + { + "boundaries": 500, + "medianCompileMs": 70.499139, + "medianPeakRssMiB": 265.328125 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 19.946639000000005, + "peakRssMiB": 125.421875, + "before": { + "rss": 115589120, + "heapTotal": 53051392, + "heapUsed": 15914912, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 131399680, + "heapTotal": 90816512, + "heapUsed": 16710184, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 227056 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 71.31020833333334, + "peakRssMiB": 265.328125, + "before": { + "rss": 177651712, + "heapTotal": 95535104, + "heapUsed": 16776736, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 277250048, + "heapTotal": 174440448, + "heapUsed": 18052448, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 20.061125000000004, + "peakRssMiB": 125.84375, + "before": { + "rss": 115572736, + "heapTotal": 52527104, + "heapUsed": 15912896, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 131710976, + "heapTotal": 89505792, + "heapUsed": 16719696, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 227056 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 70.22155566666666, + "peakRssMiB": 269.390625, + "before": { + "rss": 182566912, + "heapTotal": 95272960, + "heapUsed": 16788680, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 281509888, + "heapTotal": 175751168, + "heapUsed": 18055424, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 19.75052766666667, + "peakRssMiB": 126.046875, + "before": { + "rss": 116113408, + "heapTotal": 52264960, + "heapUsed": 15913968, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 131923968, + "heapTotal": 91340800, + "heapUsed": 16720264, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 227056 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 70.499139, + "peakRssMiB": 265.171875, + "before": { + "rss": 178192384, + "heapTotal": 97632256, + "heapUsed": 16789552, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 277086208, + "heapTotal": 175226880, + "heapUsed": 18055856, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 1143848 + } + ] +} diff --git a/benchmarks/compiler/results/final-hydrate-client-candidate.json b/benchmarks/compiler/results/final-hydrate-client-candidate.json new file mode 100644 index 00000000000..992b97b4427 --- /dev/null +++ b/benchmarks/compiler/results/final-hydrate-client-candidate.json @@ -0,0 +1,173 @@ +{ + "timestamp": "2026-09-26T14:40:52.938Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "client", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 12.600611, + "medianPeakRssMiB": 89.296875 + }, + { + "boundaries": 500, + "medianCompileMs": 52.46027800000001, + "medianPeakRssMiB": 153.015625 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 12.600611, + "peakRssMiB": 89.09375, + "before": { + "rss": 76906496, + "heapTotal": 17924096, + "heapUsed": 7289104, + "external": 3455093, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 92405760, + "heapTotal": 28934144, + "heapUsed": 7523288, + "external": 4870671, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 52.46027800000001, + "peakRssMiB": 153.015625, + "before": { + "rss": 101449728, + "heapTotal": 46759936, + "heapUsed": 7595544, + "external": 7892221, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 155172864, + "heapTotal": 77938688, + "heapUsed": 8468336, + "external": 8205704, + "arrayBuffers": 1835283 + }, + "outputBytes": 958652 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 12.819680666666665, + "peakRssMiB": 89.296875, + "before": { + "rss": 77053952, + "heapTotal": 18710528, + "heapUsed": 7288960, + "external": 3455217, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 92454912, + "heapTotal": 27885568, + "heapUsed": 7523144, + "external": 4870671, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 51.27080533333333, + "peakRssMiB": 152.03125, + "before": { + "rss": 101613568, + "heapTotal": 47808512, + "heapUsed": 7615080, + "external": 7892208, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 153960448, + "heapTotal": 78217216, + "heapUsed": 7728344, + "external": 10016168, + "arrayBuffers": 24819 + }, + "outputBytes": 958652 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 11.991555666666665, + "peakRssMiB": 92.296875, + "before": { + "rss": 77430784, + "heapTotal": 18710528, + "heapUsed": 7439424, + "external": 3455081, + "arrayBuffers": 389539 + }, + "retained": { + "rss": 95764480, + "heapTotal": 29196288, + "heapUsed": 7527168, + "external": 4858011, + "arrayBuffers": 24819 + }, + "outputBytes": 190652 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 58.747471999999995, + "peakRssMiB": 189.171875, + "before": { + "rss": 101318656, + "heapTotal": 47022080, + "heapUsed": 7615136, + "external": 7891781, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 193331200, + "heapTotal": 149504000, + "heapUsed": 8441160, + "external": 7867237, + "arrayBuffers": 1835283 + }, + "outputBytes": 958652 + } + ] +} diff --git a/benchmarks/compiler/results/final-hydrate-server-baseline.json b/benchmarks/compiler/results/final-hydrate-server-baseline.json new file mode 100644 index 00000000000..34fe18ff4dc --- /dev/null +++ b/benchmarks/compiler/results/final-hydrate-server-baseline.json @@ -0,0 +1,171 @@ +{ + "timestamp": "2026-09-26T14:40:16.933Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 16.31540266666667, + "medianPeakRssMiB": 121.203125 + }, + { + "boundaries": 500, + "medianCompileMs": 46.78787500000001, + "medianPeakRssMiB": 203.25 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 16.31540266666667, + "peakRssMiB": 121.203125, + "before": { + "rss": 111034368, + "heapTotal": 52002816, + "heapUsed": 15699576, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 126943232, + "heapTotal": 53723136, + "heapUsed": 16207544, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 46.78787500000001, + "peakRssMiB": 206.96875, + "before": { + "rss": 152633344, + "heapTotal": 91340800, + "heapUsed": 16406240, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 215908352, + "heapTotal": 166051840, + "heapUsed": 17522576, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 15.96808333333334, + "peakRssMiB": 121.046875, + "before": { + "rss": 111296512, + "heapTotal": 52264960, + "heapUsed": 15701520, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 126943232, + "heapTotal": 53723136, + "heapUsed": 16207072, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 48.541583333333335, + "peakRssMiB": 203.25, + "before": { + "rss": 148602880, + "heapTotal": 91078656, + "heapUsed": 16354896, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 211992576, + "heapTotal": 166051840, + "heapUsed": 17471744, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 16.826972, + "peakRssMiB": 134.296875, + "before": { + "rss": 125206528, + "heapTotal": 52789248, + "heapUsed": 15748712, + "external": 2331774, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 140722176, + "heapTotal": 54247424, + "heapUsed": 16254704, + "external": 2350686, + "arrayBuffers": 24947 + }, + "outputBytes": 166756 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 46.630610999999995, + "peakRssMiB": 203.234375, + "before": { + "rss": 148701184, + "heapTotal": 91602944, + "heapUsed": 16354400, + "external": 2310372, + "arrayBuffers": 24947 + }, + "retained": { + "rss": 211976192, + "heapTotal": 166051840, + "heapUsed": 17471360, + "external": 2367070, + "arrayBuffers": 24947 + }, + "outputBytes": 833956 + } + ] +} diff --git a/benchmarks/compiler/results/final-hydrate-server-candidate.json b/benchmarks/compiler/results/final-hydrate-server-candidate.json new file mode 100644 index 00000000000..78c0200daa3 --- /dev/null +++ b/benchmarks/compiler/results/final-hydrate-server-candidate.json @@ -0,0 +1,173 @@ +{ + "timestamp": "2026-09-26T14:40:53.959Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "node": "v24.8.0", + "env": "server", + "repetitions": 3, + "iterations": 3, + "summary": [ + { + "boundaries": 100, + "medianCompileMs": 8.158722333333335, + "medianPeakRssMiB": 78.796875 + }, + { + "boundaries": 500, + "medianCompileMs": 36.200527666666666, + "medianPeakRssMiB": 122.515625 + } + ], + "samples": [ + { + "repetition": 0, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.698041666666667, + "peakRssMiB": 79.703125, + "before": { + "rss": 73973760, + "heapTotal": 18219008, + "heapUsed": 8256536, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 81838080, + "heapTotal": 27099136, + "heapUsed": 7460216, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 0, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 36.10877766666667, + "peakRssMiB": 122.515625, + "before": { + "rss": 91668480, + "heapTotal": 28672000, + "heapUsed": 7294400, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 123748352, + "heapTotal": 43352064, + "heapUsed": 7423888, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + }, + { + "repetition": 1, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.100958333333331, + "peakRssMiB": 78.78125, + "before": { + "rss": 73940992, + "heapTotal": 17956864, + "heapUsed": 8264256, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 81149952, + "heapTotal": 26836992, + "heapUsed": 7463048, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 1, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 36.269764, + "peakRssMiB": 122.609375, + "before": { + "rss": 91308032, + "heapTotal": 28934144, + "heapUsed": 7293352, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 123158528, + "heapTotal": 43089920, + "heapUsed": 7423824, + "external": 5209260, + "arrayBuffers": 24819 + }, + "outputBytes": 663760 + }, + { + "repetition": 2, + "boundaries": 100, + "sourceBytes": 12797, + "sourceHash": "018082e65a31f3c1731c3ac3b8258ca79d687a31b6b668fc3c15a0fa699797cc", + "msPerCompile": 8.158722333333335, + "peakRssMiB": 78.796875, + "before": { + "rss": 74170368, + "heapTotal": 17956864, + "heapUsed": 8260432, + "external": 2847489, + "arrayBuffers": 220179 + }, + "retained": { + "rss": 81166336, + "heapTotal": 26574848, + "heapUsed": 7462864, + "external": 4033564, + "arrayBuffers": 194891 + }, + "outputBytes": 132560 + }, + { + "repetition": 2, + "boundaries": 500, + "sourceBytes": 64797, + "sourceHash": "aea6496894e0e1c67a6e9cfdcac86b2f7ac164c8cb53edd3480d2861ecaa9dad", + "msPerCompile": 36.200527666666666, + "peakRssMiB": 122.25, + "before": { + "rss": 91062272, + "heapTotal": 29196288, + "heapUsed": 7295088, + "external": 5168946, + "arrayBuffers": 24819 + }, + "retained": { + "rss": 123305984, + "heapTotal": 43876352, + "heapUsed": 7728520, + "external": 5209260, + "arrayBuffers": 897655 + }, + "outputBytes": 663760 + } + ] +} diff --git a/benchmarks/compiler/results/final-process-tree-routes-baseline.json b/benchmarks/compiler/results/final-process-tree-routes-baseline.json new file mode 100644 index 00000000000..69ceee9ebda --- /dev/null +++ b/benchmarks/compiler/results/final-process-tree-routes-baseline.json @@ -0,0 +1,49 @@ +{ + "timestamp": "2026-09-26T14:39:35.419Z", + "node": "v24.8.0", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "diagnosticOnly": true, + "sampleIntervalMs": 50, + "samples": 46, + "peakTreeMiB": 751.34375, + "peakRootMiB": 751.34375, + "descendants": [], + "worker": { + "buildMs": 1890.9189589999999, + "peakRssMiB": 751.796875, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 145309696, + "heapTotal": 106512384, + "heapUsed": 29414592, + "external": 4398576, + "arrayBuffers": 52655 + }, + "after": { + "rss": 787841024, + "heapTotal": 338608128, + "heapUsed": 207262528, + "external": 5737854, + "arrayBuffers": 150533 + }, + "retained": { + "rss": 769261568, + "heapTotal": 281264128, + "heapUsed": 56565848, + "external": 5721470, + "arrayBuffers": 68613 + } + } +} diff --git a/benchmarks/compiler/results/final-process-tree-routes-candidate.json b/benchmarks/compiler/results/final-process-tree-routes-candidate.json new file mode 100644 index 00000000000..c379af1a964 --- /dev/null +++ b/benchmarks/compiler/results/final-process-tree-routes-candidate.json @@ -0,0 +1,51 @@ +{ + "timestamp": "2026-09-26T14:39:38.859Z", + "node": "v24.8.0", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "diagnosticOnly": true, + "sampleIntervalMs": 50, + "samples": 29, + "peakTreeMiB": 633.78125, + "peakRootMiB": 633.78125, + "descendants": [], + "worker": { + "buildMs": 1123.443, + "peakRssMiB": 654, + "sourceHash": "b4c8485827ae40187aaaf5fb7df6dd644e9cdf6f56aa9b1c65bd2267f2da7139", + "chunks": 751, + "emittedJsBytes": 722613, + "before": { + "rss": 122814464, + "heapTotal": 59064320, + "heapUsed": 22902528, + "external": 4398248, + "arrayBuffers": 44335 + }, + "after": { + "rss": 664600576, + "heapTotal": 244531200, + "heapUsed": 54178200, + "external": 15042270, + "arrayBuffers": 68485 + }, + "retained": { + "rss": 655458304, + "heapTotal": 178733056, + "heapUsed": 42078408, + "external": 5639422, + "arrayBuffers": 68485 + } + } +} diff --git a/benchmarks/compiler/results/final-process-tree-start-baseline.json b/benchmarks/compiler/results/final-process-tree-start-baseline.json new file mode 100644 index 00000000000..b66ed4d93d1 --- /dev/null +++ b/benchmarks/compiler/results/final-process-tree-start-baseline.json @@ -0,0 +1,50 @@ +{ + "timestamp": "2026-09-26T14:39:37.304Z", + "node": "v24.8.0", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "diagnosticOnly": true, + "sampleIntervalMs": 50, + "samples": 35, + "peakTreeMiB": 655.40625, + "peakRootMiB": 655.40625, + "descendants": [], + "worker": { + "buildMs": 1647.9926249999999, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 674400, + "before": { + "rss": 88539136, + "heapTotal": 24625152, + "heapUsed": 14198704, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 685080576, + "heapTotal": 366329856, + "heapUsed": 268246864, + "external": 6894065, + "arrayBuffers": 474882 + }, + "retained": { + "rss": 685309952, + "heapTotal": 342818816, + "heapUsed": 135713248, + "external": 6894065, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1214457, + "hookTimings": {} + } +} diff --git a/benchmarks/compiler/results/final-process-tree-start-candidate.json b/benchmarks/compiler/results/final-process-tree-start-candidate.json new file mode 100644 index 00000000000..bb42d4eecb3 --- /dev/null +++ b/benchmarks/compiler/results/final-process-tree-start-candidate.json @@ -0,0 +1,52 @@ +{ + "timestamp": "2026-09-26T14:39:40.283Z", + "node": "v24.8.0", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "diagnosticOnly": true, + "sampleIntervalMs": 50, + "samples": 26, + "peakTreeMiB": 554.359375, + "peakRootMiB": 554.359375, + "descendants": [], + "worker": { + "buildMs": 1181.376584, + "sourceHash": "c6483f0a6aaffaeecd253b4f9b47cf6b629b5afd824b39aa1a1b2dc176a5c2f4", + "peakRssKiB": 575472, + "before": { + "rss": 89522176, + "heapTotal": 25149440, + "heapUsed": 14193960, + "external": 3832029, + "arrayBuffers": 36007 + }, + "after": { + "rss": 589037568, + "heapTotal": 239452160, + "heapUsed": 87089544, + "external": 8121323, + "arrayBuffers": 1702140 + }, + "retained": { + "rss": 586661888, + "heapTotal": 208928768, + "heapUsed": 57016152, + "external": 8121323, + "arrayBuffers": 54451 + }, + "emittedFiles": 163, + "emittedCodeBytes": 1208118, + "hookTimings": {} + } +} diff --git a/benchmarks/compiler/results/final-reuse-digest.json b/benchmarks/compiler/results/final-reuse-digest.json new file mode 100644 index 00000000000..df0d8d66b8a --- /dev/null +++ b/benchmarks/compiler/results/final-reuse-digest.json @@ -0,0 +1,181 @@ +{ + "timestamp": "2026-09-26T14:37:46.769Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 1, + "diagnosticOnly": true, + "warmups": 0, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 125.455792, + "minMsPerCorpus": 125.455792, + "maxMsPerCorpus": 125.455792, + "medianPeakRssMiB": 91.96875, + "medianRetainedHeapMiB": 7.910148620605469, + "medianWallMs": 192.366583, + "phasesMsPerCorpus": { + "parseAnalyze": 19.29133799999994, + "detectGroupings": 0.24871100000015645, + "sharedAnalysis": 2.2454170000000886, + "referenceCompile": 34.698999000000214, + "virtualCompile": 62.56008300000008, + "sharedCompile": 3.696838000000014 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + }, + "yuku-splitter-no-reuse": { + "medianMsPerCorpus": 175.826541, + "minMsPerCorpus": 175.826541, + "maxMsPerCorpus": 175.826541, + "medianPeakRssMiB": 121.515625, + "medianRetainedHeapMiB": 8.1038818359375, + "medianWallMs": 241.67729100000003, + "phasesMsPerCorpus": { + "detectGroupings": 16.564163999999835, + "sharedAnalysis": 14.455624999999856, + "referenceCompile": 45.25279100000009, + "virtualCompile": 91.25879199999949, + "sharedCompile": 5.449330000000003 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 192.366583, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 125.455792, + "phases": { + "parseAnalyze": 19.29133799999994, + "detectGroupings": 0.24871100000015645, + "sharedAnalysis": 2.2454170000000886, + "referenceCompile": 34.698999000000214, + "virtualCompile": 62.56008300000008, + "sharedCompile": 3.696838000000014 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 94176, + "before": { + "rss": 64339968, + "heapTotal": 12419072, + "heapUsed": 6543720, + "external": 2315867, + "arrayBuffers": 24819 + }, + "after": { + "rss": 96354304, + "heapTotal": 30244864, + "heapUsed": 20686872, + "external": 4552353, + "arrayBuffers": 2261613 + }, + "retained": { + "rss": 96436224, + "heapTotal": 30244864, + "heapUsed": 8294392, + "external": 4552353, + "arrayBuffers": 582447 + }, + "outputBytes": 133976, + "outputMapBytes": 498329, + "resolvedReferences": 0, + "outputDigest": "aafbde5591b2819a03c37b941ad348a026d4b0d0cb2ed679a64dd8f4e389a660", + "diagnosticOnly": true + }, + { + "repetition": 0, + "wallMs": 241.67729100000003, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 175.826541, + "phases": { + "detectGroupings": 16.564163999999835, + "sharedAnalysis": 14.455624999999856, + "referenceCompile": 45.25279100000009, + "virtualCompile": 91.25879199999949, + "sharedCompile": 5.449330000000003 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 124432, + "before": { + "rss": 65044480, + "heapTotal": 16089088, + "heapUsed": 6539968, + "external": 2275281, + "arrayBuffers": 24819 + }, + "after": { + "rss": 127287296, + "heapTotal": 50692096, + "heapUsed": 29467864, + "external": 7091043, + "arrayBuffers": 4800303 + }, + "retained": { + "rss": 127287296, + "heapTotal": 50167808, + "heapUsed": 8497536, + "external": 7091043, + "arrayBuffers": 4127683 + }, + "outputBytes": 133976, + "outputMapBytes": 498329, + "resolvedReferences": 0, + "outputDigest": "aafbde5591b2819a03c37b941ad348a026d4b0d0cb2ed679a64dd8f4e389a660", + "diagnosticOnly": true + } + ] +} diff --git a/benchmarks/compiler/results/final-reuse.json b/benchmarks/compiler/results/final-reuse.json new file mode 100644 index 00000000000..9024499b488 --- /dev/null +++ b/benchmarks/compiler/results/final-reuse.json @@ -0,0 +1,573 @@ +{ + "timestamp": "2026-09-26T14:37:31.909Z", + "compilerFingerprint": { + "commit": "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 5, + "iterations": 10, + "diagnosticOnly": false, + "warmups": 2, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 91.6949792, + "minMsPerCorpus": 89.9829209, + "maxMsPerCorpus": 92.1758667, + "medianPeakRssMiB": 198.96875, + "medianRetainedHeapMiB": 8.180564880371094, + "medianWallMs": 1218.3807499999984, + "phasesMsPerCorpus": { + "parseAnalyze": 9.92690940000016, + "detectGroupings": 0.06963810000015655, + "sharedAnalysis": 1.6392109999997047, + "referenceCompile": 25.659847499999067, + "virtualCompile": 50.11277260000052, + "sharedCompile": 3.039021700000012 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + }, + "yuku-splitter-no-reuse": { + "medianMsPerCorpus": 130.85392910000002, + "minMsPerCorpus": 129.0690542, + "maxMsPerCorpus": 138.3178375, + "medianPeakRssMiB": 334.96875, + "medianRetainedHeapMiB": 8.217262268066406, + "medianWallMs": 1707.6867089999996, + "phasesMsPerCorpus": { + "detectGroupings": 9.01144400000021, + "sharedAnalysis": 9.599993900000594, + "referenceCompile": 34.86034220000006, + "virtualCompile": 72.4999284999997, + "sharedCompile": 4.243007799999896 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1240.797625, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 916.9497920000001, + "phases": { + "parseAnalyze": 99.26909400000159, + "detectGroupings": 0.6963810000015656, + "sharedAnalysis": 15.850275999995347, + "referenceCompile": 256.5984749999907, + "virtualCompile": 504.1085680000017, + "sharedCompile": 29.730875999998034 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 203744, + "before": { + "rss": 112410624, + "heapTotal": 46235648, + "heapUsed": 8482168, + "external": 3838553, + "arrayBuffers": 350323 + }, + "after": { + "rss": 208519168, + "heapTotal": 164986880, + "heapUsed": 30861584, + "external": 8760561, + "arrayBuffers": 6469821 + }, + "retained": { + "rss": 208109568, + "heapTotal": 158957568, + "heapUsed": 8581304, + "external": 8760561, + "arrayBuffers": 6220613 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 0, + "wallMs": 1816.386875, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1383.178375, + "phases": { + "detectGroupings": 92.06434500000046, + "sharedAnalysis": 107.54070500000012, + "referenceCompile": 360.81480799999963, + "virtualCompile": 762.8833130000046, + "sharedCompile": 47.52907900000082 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 342752, + "before": { + "rss": 206749696, + "heapTotal": 80052224, + "heapUsed": 8547752, + "external": 9564691, + "arrayBuffers": 6060694 + }, + "after": { + "rss": 350814208, + "heapTotal": 190152704, + "heapUsed": 91220128, + "external": 24494659, + "arrayBuffers": 22203919 + }, + "retained": { + "rss": 350699520, + "heapTotal": 164724736, + "heapUsed": 9060120, + "external": 24494659, + "arrayBuffers": 21896205 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 1785.778667, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1359.735459, + "phases": { + "detectGroupings": 90.1144400000021, + "sharedAnalysis": 105.24423200000592, + "referenceCompile": 361.81878799999504, + "virtualCompile": 746.4530140000006, + "sharedCompile": 42.43007799999896 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 341568, + "before": { + "rss": 206667776, + "heapTotal": 78479360, + "heapUsed": 8547512, + "external": 9723293, + "arrayBuffers": 5895794 + }, + "after": { + "rss": 349601792, + "heapTotal": 189628416, + "heapUsed": 94061416, + "external": 25050835, + "arrayBuffers": 22760095 + }, + "retained": { + "rss": 349618176, + "heapTotal": 164986880, + "heapUsed": 8946344, + "external": 25050835, + "arrayBuffers": 22310501 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 1, + "wallMs": 1211.0467500000004, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 914.166166, + "phases": { + "parseAnalyze": 98.83748500000388, + "detectGroupings": 0.7346529999981612, + "sharedAnalysis": 15.690304999998034, + "referenceCompile": 259.4479289999979, + "virtualCompile": 497.8875100000025, + "sharedCompile": 30.39021700000012 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 204128, + "before": { + "rss": 111575040, + "heapTotal": 46759936, + "heapUsed": 8486656, + "external": 3820749, + "arrayBuffers": 348219 + }, + "after": { + "rss": 208945152, + "heapTotal": 164986880, + "heapUsed": 30721456, + "external": 8725649, + "arrayBuffers": 6434909 + }, + "retained": { + "rss": 208633856, + "heapTotal": 156860416, + "heapUsed": 8577104, + "external": 8725649, + "arrayBuffers": 6192885 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 1189.887208, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 899.829209, + "phases": { + "parseAnalyze": 95.80221200000028, + "detectGroupings": 0.6276410000034502, + "sharedAnalysis": 16.392109999997047, + "referenceCompile": 252.94758300000012, + "virtualCompile": 492.35181500000294, + "sharedCompile": 31.012206999997943 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 201472, + "before": { + "rss": 112459776, + "heapTotal": 46235648, + "heapUsed": 8482928, + "external": 3967635, + "arrayBuffers": 236879 + }, + "after": { + "rss": 206225408, + "heapTotal": 164724736, + "heapUsed": 33461560, + "external": 9334099, + "arrayBuffers": 7043359 + }, + "retained": { + "rss": 205537280, + "heapTotal": 156073984, + "heapUsed": 8577056, + "external": 9334099, + "arrayBuffers": 6779975 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 2, + "wallMs": 1679.4691660000008, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1290.690542, + "phases": { + "detectGroupings": 79.35911899999519, + "sharedAnalysis": 92.35180500000092, + "referenceCompile": 348.59390900000267, + "virtualCompile": 720.4510829999995, + "sharedCompile": 38.906962000002295 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 343008, + "before": { + "rss": 208207872, + "heapTotal": 77692928, + "heapUsed": 8559120, + "external": 6078987, + "arrayBuffers": 272311 + }, + "after": { + "rss": 351076352, + "heapTotal": 185171968, + "heapUsed": 70892624, + "external": 19916557, + "arrayBuffers": 17625817 + }, + "retained": { + "rss": 351076352, + "heapTotal": 157908992, + "heapUsed": 8615824, + "external": 19916557, + "arrayBuffers": 17075657 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 3, + "wallMs": 1707.6867089999996, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1308.539291, + "phases": { + "detectGroupings": 90.31155100000092, + "sharedAnalysis": 95.99993900000595, + "referenceCompile": 342.3203359999991, + "virtualCompile": 724.9992849999969, + "sharedCompile": 43.737286999999014 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 353904, + "before": { + "rss": 207421440, + "heapTotal": 79265792, + "heapUsed": 8547904, + "external": 9557625, + "arrayBuffers": 6054735 + }, + "after": { + "rss": 362250240, + "heapTotal": 197754880, + "heapUsed": 99800384, + "external": 27431681, + "arrayBuffers": 25140941 + }, + "retained": { + "rss": 360759296, + "heapTotal": 161054720, + "heapUsed": 8616424, + "external": 27431681, + "arrayBuffers": 24546109 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 3, + "wallMs": 1218.3807499999984, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 921.758667, + "phases": { + "parseAnalyze": 101.14302300000122, + "detectGroupings": 0.7046840000023167, + "sharedAnalysis": 17.399623999998084, + "referenceCompile": 260.00034299999925, + "virtualCompile": 501.12772600000517, + "sharedCompile": 30.646919000000025 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 203664, + "before": { + "rss": 113344512, + "heapTotal": 46759936, + "heapUsed": 8482304, + "external": 3937346, + "arrayBuffers": 349663 + }, + "after": { + "rss": 208502784, + "heapTotal": 165511168, + "heapUsed": 30795720, + "external": 8725649, + "arrayBuffers": 6434909 + }, + "retained": { + "rss": 207765504, + "heapTotal": 156860416, + "heapUsed": 8577944, + "external": 8725649, + "arrayBuffers": 5894481 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 4, + "wallMs": 1226.6889579999988, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 917.5020420000001, + "phases": { + "parseAnalyze": 101.5694680000031, + "detectGroupings": 0.6845850000020164, + "sharedAnalysis": 16.753507999995236, + "referenceCompile": 255.4191510000005, + "virtualCompile": 503.3937049999902, + "sharedCompile": 29.219788000000108 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 211712, + "before": { + "rss": 112312320, + "heapTotal": 46497792, + "heapUsed": 8482080, + "external": 3817721, + "arrayBuffers": 460331 + }, + "after": { + "rss": 216743936, + "heapTotal": 166559744, + "heapUsed": 69138216, + "external": 17454938, + "arrayBuffers": 15164198 + }, + "retained": { + "rss": 215384064, + "heapTotal": 157384704, + "heapUsed": 8627568, + "external": 17454938, + "arrayBuffers": 14969618 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + }, + { + "repetition": 4, + "wallMs": 1702.6033339999994, + "mode": "yuku-splitter-no-reuse", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1294.777583, + "phases": { + "detectGroupings": 87.43793000000119, + "sharedAnalysis": 91.81730599999901, + "referenceCompile": 348.6034220000006, + "virtualCompile": 715.2856340000023, + "sharedCompile": 40.44937400000117 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 348880, + "before": { + "rss": 207028224, + "heapTotal": 78741504, + "heapUsed": 8548808, + "external": 9601721, + "arrayBuffers": 6167215 + }, + "after": { + "rss": 357089280, + "heapTotal": 196706304, + "heapUsed": 96525928, + "external": 26685236, + "arrayBuffers": 24394496 + }, + "retained": { + "rss": 355794944, + "heapTotal": 162103296, + "heapUsed": 8612312, + "external": 26685236, + "arrayBuffers": 23974094 + }, + "outputBytes": 1607712, + "outputMapBytes": 5979948, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/route-heavy.mjs b/benchmarks/compiler/route-heavy.mjs index f024c33d983..4b012ecf4e1 100644 --- a/benchmarks/compiler/route-heavy.mjs +++ b/benchmarks/compiler/route-heavy.mjs @@ -75,6 +75,7 @@ if (!args.includes('--worker')) { cpu: cpus()[0].model, routes, repetitions, + diagnosticOnly: profileAnalysis, ...(cacheLimit === null ? {} : { analysisCacheLimit: Number(cacheLimit) }), From 22be2cc72d9dd37631a5338a6e17fa510a459382 Mon Sep 17 00:00:00 2001 From: Sheraff Date: Sat, 26 Sep 2026 17:11:38 +0200 Subject: [PATCH 003/152] feat: migrate Router and Start compilation to Yuku --- .changeset/smooth-parrots-argue.md | 11 + RESULT-optimization-yuku.md | 328 + benchmarks/compiler/README.md | 48 + .../results/bundle-after-pre-cleanup.json | 7320 +++++++++++++++++ benchmarks/compiler/results/bundle-after.json | 7320 +++++++++++++++++ .../compiler/results/bundle-before.json | 7320 +++++++++++++++++ .../compiler/results/workflow-after.json | 107 + .../compiler/results/workflow-before.json | 103 + .../compiler/results/workflow-contracts.json | 64 + .../compiler/yuku-feasibility/README.md | 64 + .../jsx-prefixed-route-repro.mjs | 99 + .../yuku-feasibility/jsx-reference-repro.mjs | 65 + .../jsx-reference-upstream.patch | 61 + .../src/plugin/rscCssTransform.ts | 93 +- .../tests/rscCssTransform.test.tsx | 18 +- packages/router-generator/package.json | 5 +- .../src/transform/transform.ts | 127 +- .../router-generator/tests/transform.test.ts | 4 +- .../ARCHITECTURE-CODE-SPLITTING.md | 243 +- packages/router-plugin/package.json | 10 +- .../src/core/code-splitter/compilers.ts | 2510 ++---- .../src/core/code-splitter/plugins.ts | 45 +- .../react-refresh-ignored-route-exports.ts | 53 +- .../plugins/react-refresh-route-components.ts | 73 +- ...react-stable-hmr-split-route-components.ts | 75 +- .../src/core/hmr/select-adapter.ts | 4 +- .../src/core/hmr/vite-adapter.ts | 17 +- .../src/core/hmr/webpack-adapter.ts | 17 +- .../src/core/router-code-splitter-plugin.ts | 36 + .../src/core/router-hmr-plugin.ts | 11 +- packages/router-plugin/src/core/utils.ts | 51 +- packages/router-plugin/tests/add-hmr.test.ts | 32 +- .../snapshots/react/arrow-function@false.tsx | 9 +- .../snapshots/react/arrow-function@true.tsx | 46 +- .../react/arrow-function@webpack-hot.tsx | 44 +- ...teFileRoute-lowercase-components@false.tsx | 12 +- ...ateFileRoute-lowercase-components@true.tsx | 53 +- .../createRootRoute-inline-component@true.tsx | 37 +- ...ateRootRoute-lowercase-components@true.tsx | 45 +- .../snapshots/react/createRootRoute@true.tsx | 37 +- ...ateRootRouteWithContext-type-args@true.tsx | 37 +- .../explicit-undefined-component@true.tsx | 37 +- .../react/function-declaration@false.tsx | 9 +- .../react/function-declaration@true.tsx | 46 +- .../snapshots/react/multi-component@false.tsx | 12 +- .../snapshots/react/multi-component@true.tsx | 53 +- .../react/string-literal-keys@false.tsx | 12 +- .../react/string-literal-keys@true.tsx | 53 +- .../snapshots/solid/arrow-function@false.tsx | 9 +- .../snapshots/solid/arrow-function@true.tsx | 36 +- .../router-plugin/tests/code-splitter.test.ts | 348 +- .../react/1-default/arrow-function.tsx | 9 +- .../1-default/arrow-function@component.tsx | 23 +- .../react/1-default/boolean-null-literals.tsx | 14 +- .../boolean-null-literals@component.tsx | 1 - .../snapshots/react/1-default/chinese.tsx | 8 +- .../react/1-default/chinese@component.tsx | 17 +- .../circular-reference-arrow-function.tsx | 8 +- ...lar-reference-arrow-function@component.tsx | 12 +- .../1-default/circular-reference-function.tsx | 8 +- .../circular-reference-function@component.tsx | 12 +- .../1-default/conditional-properties.tsx | 9 +- .../destructured-export-multiple.tsx | 18 +- ...destructured-export-multiple@component.tsx | 4 +- .../1-default/destructured-export-nested.tsx | 23 +- .../destructured-export-nested@component.tsx | 4 +- .../react/1-default/destructured-export.tsx | 19 +- .../destructured-export@component.tsx | 12 +- .../destructured-export@errorComponent.tsx | 8 - .../destructured-export@notFoundComponent.tsx | 8 - ...ructured-react-memo-imported-component.tsx | 9 +- .../destructured-route-options-defaults.tsx | 9 +- ...ructured-route-options-defaults@shared.tsx | 18 +- .../1-default/destructuring@component.tsx | 8 +- .../destructuring@errorComponent.tsx | 8 +- .../destructuring@notFoundComponent.tsx | 8 +- .../react/1-default/directive-prologue.tsx | 9 +- .../directive-prologue@component.tsx | 1 - ...-default-component-and-normal-notFound.tsx | 13 +- .../react/1-default/function-declaration.tsx | 9 +- .../function-declaration@component.tsx | 23 +- .../react/1-default/importAttribute.tsx | 8 +- ...-default-component-destructured-loader.tsx | 9 +- ...omponent-destructured-loader@component.tsx | 3 +- .../1-default/imported-default-component.tsx | 8 +- .../imported-default-component@component.tsx | 3 +- .../1-default/imported-errorComponent.tsx | 11 +- .../imported-errorComponent@component.tsx | 3 +- ...imported-errorComponent@errorComponent.tsx | 3 +- .../1-default/imported-notFoundComponent.tsx | 11 +- .../imported-notFoundComponent@component.tsx | 3 +- ...ed-notFoundComponent@notFoundComponent.tsx | 3 +- .../1-default/imported-pendingComponent.tsx | 9 +- .../imported-pendingComponent@component.tsx | 3 +- .../snapshots/react/1-default/imported.tsx | 9 +- .../react/1-default/imported@component.tsx | 3 +- .../snapshots/react/1-default/inline.tsx | 8 +- .../react/1-default/inline@component.tsx | 7 +- .../react/1-default/inline@errorComponent.tsx | 4 +- .../1-default/inline@notFoundComponent.tsx | 4 +- .../lowercase-function-declaration.tsx | 12 +- .../react/1-default/method-route-options.tsx | 11 + .../method-route-options@component.tsx | 0 .../method-route-options@errorComponent.tsx | 3 + ...method-route-options@notFoundComponent.tsx | 0 .../1-default/method-route-options@shared.tsx | 2 + .../react/1-default/random-number.tsx | 23 +- .../1-default/random-number@component.tsx | 42 +- .../random-number@errorComponent.tsx | 7 +- .../random-number@notFoundComponent.tsx | 7 +- .../react/1-default/react-memo-component.tsx | 9 +- .../react-memo-imported-component.tsx | 9 +- .../retain-exports-destructured@component.tsx | 2 - .../retain-exports-destructured@shared.tsx | 12 +- .../react/1-default/retain-exports-loader.tsx | 13 +- .../retain-exports-loader@component.tsx | 8 +- .../react/1-default/shared-class.tsx | 13 +- .../1-default/shared-destructured-export.tsx | 9 +- .../shared-destructured-export@shared.tsx | 10 +- .../react/1-default/shared-destructured.tsx | 9 +- .../1-default/shared-destructured@shared.tsx | 10 +- .../react/1-default/shared-exported.tsx | 15 +- .../1-default/shared-exported@shared.tsx | 5 +- .../react/1-default/shared-function.tsx | 15 +- .../1-default/shared-imported-binding.tsx | 9 +- .../react/1-default/shared-indirect-ref.tsx | 17 +- .../shared-indirect-ref@component.tsx | 4 +- .../1-default/shared-indirect-ref@shared.tsx | 4 +- .../1-default/shared-jsx-component-ref.tsx | 9 +- .../shared-jsx-component-ref@component.tsx | 2 +- .../shared-jsx-component-ref@shared.tsx | 2 - .../snapshots/react/1-default/shared-none.tsx | 9 +- .../react/1-default/shared-none@component.tsx | 4 +- .../1-default/shared-referencing-route.tsx | 17 +- .../shared-referencing-route@component.tsx | 2 +- .../react/1-default/shared-runtime.tsx | 29 +- .../1-default/shared-runtime@component.tsx | 12 +- .../react/1-default/shared-runtime@shared.tsx | 37 +- .../react/1-default/shared-transitive.tsx | 13 +- .../1-default/shared-transitive@shared.tsx | 5 +- .../react/1-default/shared-variable.tsx | 17 +- .../1-default/shared-variable@shared.tsx | 5 +- .../1-default/shared-with-side-effect.tsx | 13 +- .../arrow-function.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 23 +- .../arrow-function@loader.tsx | 3 +- .../boolean-null-literals.tsx | 16 +- ...--notFoundComponent---pendingComponent.tsx | 1 - .../boolean-null-literals@loader.tsx | 5 +- .../chinese.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 17 +- .../circular-reference-arrow-function.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../circular-reference-function.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../conditional-properties.tsx | 13 +- .../destructured-export-multiple.tsx | 18 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../destructured-export-nested.tsx | 23 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../destructured-export.tsx | 19 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../destructured-export@loader.tsx | 8 - ...ructured-react-memo-imported-component.tsx | 13 +- ...d-react-memo-imported-component@loader.tsx | 3 +- .../destructured-route-options-defaults.tsx | 13 +- ...ructured-route-options-defaults@shared.tsx | 18 +- ...--notFoundComponent---pendingComponent.tsx | 8 +- .../destructuring@loader.tsx | 8 +- .../directive-prologue.tsx | 9 +- ...--notFoundComponent---pendingComponent.tsx | 1 - ...-default-component-and-normal-notFound.tsx | 13 +- .../function-declaration.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 23 +- .../function-declaration@loader.tsx | 3 +- .../importAttribute.tsx | 8 +- ...-default-component-destructured-loader.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- ...t-component-destructured-loader@loader.tsx | 3 +- .../imported-default-component.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- .../imported-errorComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported-notFoundComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported-pendingComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- .../imported@loader.tsx | 3 +- .../inline.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 7 +- .../inline@loader.tsx | 4 +- .../lowercase-function-declaration.tsx | 14 +- .../method-route-options.tsx | 11 + ...--notFoundComponent---pendingComponent.tsx | 3 + .../method-route-options@loader.tsx | 0 .../method-route-options@shared.tsx | 2 + .../random-number.tsx | 20 +- ...--notFoundComponent---pendingComponent.tsx | 42 +- .../random-number@loader.tsx | 12 +- .../react-memo-component.tsx | 13 +- .../react-memo-component@loader.tsx | 3 +- .../react-memo-imported-component.tsx | 13 +- .../react-memo-imported-component@loader.tsx | 3 +- .../retain-export-component.tsx | 17 +- .../retain-export-component@loader.tsx | 3 +- ...--notFoundComponent---pendingComponent.tsx | 2 - .../retain-exports-destructured@loader.tsx | 2 - .../retain-exports-destructured@shared.tsx | 12 +- .../retain-exports-loader.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 8 +- .../shared-class.tsx | 13 +- .../shared-destructured-export.tsx | 13 +- .../shared-destructured-export@shared.tsx | 10 +- .../shared-destructured.tsx | 13 +- .../shared-destructured@shared.tsx | 10 +- .../shared-exported.tsx | 13 +- .../shared-exported@loader.tsx | 4 +- .../shared-exported@shared.tsx | 5 +- .../shared-function.tsx | 13 +- .../shared-function@loader.tsx | 2 +- .../shared-imported-binding.tsx | 13 +- .../shared-indirect-ref.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../shared-indirect-ref@loader.tsx | 4 +- .../shared-indirect-ref@shared.tsx | 4 +- .../shared-jsx-component-ref.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 2 +- .../shared-jsx-component-ref@loader.tsx | 2 +- .../shared-jsx-component-ref@shared.tsx | 2 - .../shared-none.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../shared-referencing-route.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 2 +- .../shared-referencing-route@loader.tsx | 6 +- .../shared-runtime.tsx | 27 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../shared-runtime@loader.tsx | 12 +- .../shared-runtime@shared.tsx | 37 +- .../shared-transitive.tsx | 13 +- .../shared-transitive@shared.tsx | 5 +- .../shared-variable.tsx | 13 +- .../shared-variable@loader.tsx | 4 +- .../shared-variable@shared.tsx | 5 +- .../shared-with-side-effect.tsx | 13 +- .../using.tsx | 8 +- .../using@loader.tsx | 15 +- .../arrow-function.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 26 +- .../boolean-null-literals.tsx | 16 +- ...--notFoundComponent---pendingComponent.tsx | 9 +- .../chinese.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 17 +- .../circular-reference-arrow-function.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../circular-reference-function.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../conditional-properties.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../destructured-export-multiple.tsx | 18 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../destructured-export-nested.tsx | 23 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../destructured-export.tsx | 19 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../destructured-export@errorComponent.tsx | 8 - ...ructured-react-memo-imported-component.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 5 +- .../destructured-route-options-defaults.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 20 +- ...--notFoundComponent---pendingComponent.tsx | 8 +- .../destructuring@errorComponent.tsx | 8 +- .../directive-prologue.tsx | 9 +- ...--notFoundComponent---pendingComponent.tsx | 1 - ...-default-component-and-normal-notFound.tsx | 13 +- .../function-declaration.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 26 +- .../importAttribute.tsx | 8 +- ...-default-component-destructured-loader.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported-default-component.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- .../imported-errorComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- ...imported-errorComponent@errorComponent.tsx | 3 +- .../imported-notFoundComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported-pendingComponent.tsx | 11 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../imported.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../inline.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 7 +- .../inline@errorComponent.tsx | 4 +- .../lowercase-function-declaration.tsx | 14 +- .../method-route-options.tsx | 11 + ...--notFoundComponent---pendingComponent.tsx | 0 .../method-route-options@errorComponent.tsx | 3 + .../method-route-options@shared.tsx | 2 + .../random-number.tsx | 20 +- ...--notFoundComponent---pendingComponent.tsx | 47 +- .../random-number@errorComponent.tsx | 7 +- .../react-memo-component.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 5 +- .../react-memo-imported-component.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 5 +- .../retain-export-component.tsx | 17 +- ...--notFoundComponent---pendingComponent.tsx | 3 +- ...--notFoundComponent---pendingComponent.tsx | 1 - .../retain-exports-loader.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 8 +- .../shared-class.tsx | 22 +- .../shared-class@errorComponent.tsx | 9 - .../shared-destructured-export.tsx | 23 +- .../shared-destructured.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 10 +- .../shared-exported.tsx | 18 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../shared-function.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 2 +- .../shared-imported-binding.tsx | 13 +- .../shared-indirect-ref.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../shared-jsx-component-ref.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 2 - .../shared-none.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 4 +- .../shared-referencing-route.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 6 +- .../shared-runtime.tsx | 27 +- ...--notFoundComponent---pendingComponent.tsx | 12 +- .../shared-runtime@shared.tsx | 37 +- .../shared-transitive.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 5 +- .../shared-variable.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 9 +- .../shared-with-side-effect.tsx | 13 +- .../using.tsx | 8 +- ...--notFoundComponent---pendingComponent.tsx | 15 +- .../solid/1-default/arrow-function.tsx | 9 +- .../1-default/arrow-function@component.tsx | 20 +- .../arrow-function.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 20 +- .../arrow-function@loader.tsx | 3 +- .../arrow-function.tsx | 13 +- ...--notFoundComponent---pendingComponent.tsx | 23 +- .../test-files/react/method-route-options.tsx | 16 + .../createRootRoute-ssr-function.tsx | 8 +- ...reateRootRouteWithContext-ssr-function.tsx | 8 +- .../3-delete-nodes-ssr/ssr-data-only.tsx | 8 +- .../react/3-delete-nodes-ssr/ssr-false.tsx | 8 +- .../react/3-delete-nodes-ssr/ssr-function.tsx | 8 +- .../3-delete-nodes-ssr/ssr-data-only.tsx | 8 +- .../solid/3-delete-nodes-ssr/ssr-false.tsx | 8 +- .../solid/3-delete-nodes-ssr/ssr-function.tsx | 8 +- .../detect-route-codesplit-groupings.test.ts | 4 +- .../tests/router-plugin-context.test.ts | 32 +- .../tests/shared-bindings-helpers.test.ts | 627 -- packages/router-plugin/tests/utils.test.ts | 71 +- packages/router-utils/package.json | 13 +- packages/router-utils/src/ast.ts | 312 +- packages/router-utils/src/compiler-helpers.ts | 1245 +-- packages/router-utils/src/index.ts | 50 +- packages/router-utils/tests/ast.test-d.ts | 25 + .../tests/compiler-helpers.test.ts | 580 +- .../tests/stripTypeExports.test.ts | 18 +- packages/start-plugin-core/package.json | 10 +- .../src/hydrate-when-transform.ts | 1197 ++- .../src/import-protection/INTERNALS.md | 15 +- .../src/import-protection/analysis.ts | 709 +- .../src/import-protection/rewrite.ts | 285 +- .../src/import-protection/sourceLocation.ts | 4 +- .../src/rsbuild/start-compiler-host.ts | 7 +- .../src/start-compiler/compiler.ts | 1021 +-- .../src/start-compiler/handleClientOnlyJSX.ts | 7 +- .../handleCreateIsomorphicFn.ts | 31 +- .../start-compiler/handleCreateMiddleware.ts | 14 +- .../start-compiler/handleCreateServerFn.ts | 648 +- .../src/start-compiler/handleEnvOnly.ts | 55 +- .../src/start-compiler/types.ts | 17 +- .../src/start-compiler/utils.ts | 132 +- packages/start-plugin-core/src/types.ts | 24 +- .../snapshots/server/clientOnlyBasic.tsx | 4 +- .../snapshots/server/clientOnlyMultiple.tsx | 4 +- .../snapshots/server/clientOnlyNested.tsx | 4 +- .../snapshots/server/clientOnlyNoFallback.tsx | 4 +- .../snapshots/server/clientOnlyRenamed.tsx | 4 +- .../start-plugin-core/tests/compiler.test.ts | 73 +- .../client/createIsomorphicFnFactory.tsx | 5 - .../client/createIsomorphicFnInline.tsx | 10 +- .../server/createIsomorphicFnFactory.tsx | 5 - .../server/createIsomorphicFnInline.tsx | 10 +- .../createMiddleware/createMiddleware.test.ts | 4 +- .../client/create-function-middleware.ts | 4 +- .../client/createMiddlewareDestructured.tsx | 16 +- .../createMiddlewareDestructuredRename.tsx | 16 +- .../client/createMiddlewareStarImport.tsx | 16 +- .../client/createMiddlewareValidator.tsx | 4 +- .../snapshots/client/createStart.tsx | 10 +- .../snapshots/client/middleware-factory.ts | 17 +- .../createServerFn/createServerFn.test.ts | 18 +- .../client/createServerFnDestructured.tsx | 28 +- .../createServerFnDestructuredRename.tsx | 16 +- .../client/createServerFnStarImport.tsx | 16 +- .../client/createServerFnValidator.tsx | 4 +- .../snapshots/client/factory.tsx | 32 +- .../snapshots/client/isomorphic-fns.tsx | 43 +- .../createServerFnDestructured.tsx | 28 +- .../createServerFnDestructuredRename.tsx | 16 +- .../createServerFnStarImport.tsx | 16 +- .../server-caller/createServerFnValidator.tsx | 4 +- .../snapshots/server-caller/factory.tsx | 32 +- .../server-caller/isomorphic-fns.tsx | 43 +- .../createServerFnDestructured.tsx | 88 +- .../createServerFnDestructuredRename.tsx | 56 +- .../createServerFnStarImport.tsx | 57 +- .../createServerFnValidator.tsx | 12 +- .../snapshots/server-provider/factory.tsx | 44 +- .../server-provider/isomorphic-fns.tsx | 18 +- .../snapshots/client/envOnlyFactory.tsx | 4 - .../snapshots/server/envOnlyFactory.tsx | 4 - .../tests/hydrate-when-transform.test.ts | 61 +- .../tests/hydrateWhen/hydrateWhen.test.ts | 86 +- .../snapshots/client/hydrateWhenBasic.tsx | 17 +- .../snapshots/client/hydrateWhenMultiple.tsx | 22 +- .../snapshots/client/hydrateWhenNested.tsx | 16 +- .../snapshots/client/hydrateWhenNever.tsx | 6 +- .../client/hydrateWhenObjectFallback.tsx | 30 +- .../client/hydrateWhenPrefetchState.tsx | 16 +- .../snapshots/client/hydrateWhenRenamed.tsx | 8 +- .../snapshots/server/hydrateWhenBasic.tsx | 11 +- .../snapshots/server/hydrateWhenMultiple.tsx | 4 +- .../snapshots/server/hydrateWhenNested.tsx | 4 +- .../snapshots/server/hydrateWhenNever.tsx | 4 +- .../server/hydrateWhenObjectFallback.tsx | 12 +- .../server/hydrateWhenPrefetchState.tsx | 10 +- .../snapshots/server/hydrateWhenRenamed.tsx | 6 +- .../server/hydrateWhenSplitFalse.tsx | 4 +- .../hydrateWhenNested.tsx.H0.client.tsx | 6 +- pnpm-lock.yaml | 902 +- pnpm-workspace.yaml | 2 - 442 files changed, 28845 insertions(+), 10730 deletions(-) create mode 100644 .changeset/smooth-parrots-argue.md create mode 100644 RESULT-optimization-yuku.md create mode 100644 benchmarks/compiler/results/bundle-after-pre-cleanup.json create mode 100644 benchmarks/compiler/results/bundle-after.json create mode 100644 benchmarks/compiler/results/bundle-before.json create mode 100644 benchmarks/compiler/results/workflow-after.json create mode 100644 benchmarks/compiler/results/workflow-before.json create mode 100644 benchmarks/compiler/results/workflow-contracts.json create mode 100644 benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs create mode 100644 benchmarks/compiler/yuku-feasibility/jsx-reference-repro.mjs create mode 100644 benchmarks/compiler/yuku-feasibility/jsx-reference-upstream.patch create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@component.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@errorComponent.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@notFoundComponent.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@shared.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@component---errorComponent---notFoundComponent---pendingComponent.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@loader.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@shared.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@component---loader---notFoundComponent---pendingComponent.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@errorComponent.tsx create mode 100644 packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@shared.tsx create mode 100644 packages/router-plugin/tests/code-splitter/test-files/react/method-route-options.tsx create mode 100644 packages/router-utils/tests/ast.test-d.ts diff --git a/.changeset/smooth-parrots-argue.md b/.changeset/smooth-parrots-argue.md new file mode 100644 index 00000000000..c931b0bbb1f --- /dev/null +++ b/.changeset/smooth-parrots-argue.md @@ -0,0 +1,11 @@ +--- +'@tanstack/router-utils': major +'@tanstack/router-plugin': major +'@tanstack/start-plugin-core': major +'@tanstack/router-generator': patch +'@tanstack/react-start-rsc': patch +--- + +Replace Babel-based route and Start compilation with Yuku's native parser, semantic analysis, AST utilities, and code generator. Share immutable route analysis across chunk planning and generation while preserving independent output trees and bounded cache lifetimes. + +Compiler extension hooks and AST helpers now expose Yuku nodes and semantic context. Babel nodes, traversal paths, and helper APIs are removed; extensions must migrate to the native interfaces. Routing and server-function runtime contracts remain unchanged. diff --git a/RESULT-optimization-yuku.md b/RESULT-optimization-yuku.md new file mode 100644 index 00000000000..77e5fdc1080 --- /dev/null +++ b/RESULT-optimization-yuku.md @@ -0,0 +1,328 @@ +# Native Yuku compiler migration + +**Status: blocked on Yuku 0.11.0 analyzer correctness. Implementation and local +evaluation are complete, but this migration is not ready to land. Adoption +requires an upstream analyzer fix and +subsequent correctness, performance, and bundle reruns.** A newly confirmed +semantic failure overrides the passing existing suites: standalone JSX component +names beginning with `_`, `$`, or Unicode are omitted from Yuku's reference +records, so the native route compiler can generate a chunk with an unresolved +component binding. No local workaround has been implemented. + +All measurements below describe the current implementation before resolution +of that defect. They demonstrate potential performance improvements on their +recorded inputs, not a correctness-qualified adoption recommendation. + +## Scope and architecture + +The compiler packages use Yuku 0.11.0 for parsing, semantic analysis, AST +transformation, and code generation. There is no Babel compatibility layer or +fallback in the migrated compiler. Babel can still occur transitively in +unrelated framework tooling. + +The migration covers router-utils, route generation, route splitting and HMR, +Start server functions and environment transforms, import protection, deferred +hydration, and the React Start RSC CSS transform. Runtime route APIs remain +unchanged. Exported compiler extension interfaces intentionally change from +Babel nodes and traversal paths to native Yuku nodes and semantic context; +the changeset marks those packages as major releases. + +An immutable source module owns syntax and symbol information. Each generated +output has its own cloned tree and a mapping back to source nodes. Chunk +ownership and dependency analysis use native symbol identity. Generated +references carry explicit binding provenance so lexical cleanup preserves +references introduced by transforms without guessing from identifier names. + +Route analysis is reused across grouping detection, shared-binding planning, +and output generation. The bundler plugin keeps a bounded source-sensitive +cache and clears it at build completion. This is opportunistic reuse, not a +guarantee of one parse per route for every request order. In the initial +250-route Vite profile, the 128-entry bound caused each route to be analyzed +three times. Generated snippets also require parsing separately. + +## Evaluation design + +The baseline compiler is commit `bb4423e09872aee4f2544600d0eba3303fc7db56` in a +separate managed checkout. Supporting commits `0ec43cd02c` and `f69eb7a5aa` +add only tests and benchmark artifacts to both checkouts; they do not change +that baseline compiler. The five alternating pairs were recorded at the first +supporting commit; the later stash-workflow checks and bundles use the second. +Measurements use Node 24.8.0 and pnpm 11.21.0 on macOS arm64 +(Apple M3 Max), the same input sources, and freshly built workspace packages. +Reported speed runs exclude concurrent tests, builds, and installations. +Instrumented profiling and process-tree memory sampling run separately from +uninstrumented timing. + +The compiler corpus generates every configured output for three grouping +configurations. Application measurements include Vite configuration loading, +transforms, bundling, minification, and output writes; they exclude the separate +TypeScript check and Nx orchestration. Fresh processes still share warm OS +filesystem caches. Results are workload-specific. + +The native AST model, symbol-based cleanup, and consuming transforms are a +dependent implementation group: the breaking AST interface cannot be switched +independently in one consumer. Analysis reuse is separately attributable with +the native benchmark's no-reuse mode, without adding a production fallback or +compatibility option. Test, documentation, and benchmark changes do not affect +emitted application code. + +## Final speed and process-memory results + +Five fresh baseline/native pairs alternate execution order between repetitions. +Each compiler process performs two warmups and ten measured corpus passes; +application samples are one complete production build per fresh process. The +table reports medians across processes. Source and executable compiler hashes +were stable throughout, and baseline/candidate input hashes match. + +| Workload | Babel | Yuku | Time reduction | Median peak RSS, Babel → Yuku | +| -------------------------------------------- | ---------: | ---------: | -------------: | ----------------------------: | +| Complete splitter, original 52 fixtures | 295.71 ms | 88.70 ms | 70.0% | 397.25 → 200.66 MiB | +| Synthetic 250-route Vite production build | 1807.10 ms | 1054.69 ms | 41.6% | 732.9 → 647.8 MiB | +| Real Start server-functions production build | 1530.60 ms | 1038.35 ms | 32.2% | 658.7 → 545.6 MiB | + +The compiler process averages ranged from 294.85–302.86 ms for Babel and +88.11–90.38 ms for Yuku. Production route builds ranged from 1720.87–1871.08 ms +and 1043.91–1104.89 ms respectively; Start builds ranged from 1467.79–1571.32 ms +and 1013.42–1074.08 ms. Sample coefficients of variation were 1.1–3.4% across +the six timing groups. Five processes support these workload-level conclusions, +not tail-latency estimates or guarantees for every application. + +The synthetic route outputs remain 751 chunks and 722,613 JavaScript bytes. +Both Start builds emit 163 files; emitted JavaScript across the application +output decreases from 1,214,457 to 1,208,118 bytes. These raw output counts do +not substitute for the separate client gzip bundle-size comparison. + +Raw samples, run order, source hashes, executable hashes, and dependency +versions are in [final-alternating.json](benchmarks/compiler/results/final-alternating.json). + +Final native reuse attribution measured 91.69 ms with reuse versus 130.85 ms +without (29.9% lower), with median peak RSS of 199.0 versus 335.0 MiB. A +separate diagnostic SHA-256 check confirms identical generated code and source +maps; hashing is excluded from speed measurements. + +Separate process-tree sampling at 50 ms intervals measured route-build peaks +of 751.3 → 633.8 MiB and Start-build peaks of 655.4 → 554.4 MiB. No descendant +subprocesses were observed in these runs. Short-lived peaks can fall between +samples; these diagnostic timings are not included in the speed table. + +Cache experiments compared bounds of 128, 256, and 512. With 250 routes, +increasing the bound reduced full route analyses from 751 to 251. With 750 +routes, the working set still exceeded each bound and analysis reuse remained +limited. Raising the bound to 512 lowered the observed median by about 3.3% +in that larger case while increasing peak RSS by about 4.0%; three speed +samples per variant do not establish a statistically reliable benefit. The +750-route diagnostics observed approximately 8/15/29 MiB heap drops across +cache clearing with forced GC at the respective bounds. These are observations, +not exact attribution of native allocations to the cache. The production +default remains 128: the small-workload gain does not justify greater retained +memory and weak gains when the working set exceeds the cache. The migration +therefore does not claim that every physical route is parsed exactly once. + +## Initial measured results + +Three fresh processes, two warmup passes and five measured passes per compiler +process; application builds use three fresh processes: + +| Workload | Babel | Yuku | Median peak process RSS, Babel → Yuku | +| --------------------------------------- | ---------: | ---------: | ------------------------------------: | +| Complete splitter, original 52 fixtures | 313.16 ms | 92.05 ms | 385.7 → 183.3 MiB | +| Production build, synthetic 250 routes | 1800.76 ms | 1048.70 ms | 729.3 → 631.7 MiB | + +The first comparison is 3.40× faster; the production workload is 1.72× faster. +Both engines produced 517 compiler outputs. The application builds produced +751 chunks and 722,613 JavaScript bytes from identical source hashes. + +A separate native reuse comparison measured 100.47 ms with reuse and 140.69 ms +without reuse (28.6% reduction), with identical code and source-map byte totals. +Peak process RSS was 186.5 versus 294.5 MiB. These initial measurements are +retained in `benchmarks/compiler/results/quiet-initial-*.json`. The five-pair +final comparison above is the primary performance evidence. + +## Measured algorithmic corrections + +Independent review identified repeated whole-tree searches for Hydrate spread +bindings and a complete graph between bindings in one destructuring declaration. +Focused stress cases measured those mechanisms before making further changes. +The Hydrate case exposed an actual migration regression at 500 boundaries; +the destructuring case was already faster than Babel but allocated redundant +dependency edges. + +The retained changes are a single local object-expression index before Hydrate +mutation, including forward declarations, and bidirectional edges between one +representative and each sibling, with the same transitive reachability as the +complete graph. Neither change adds +a compatibility path or changes output ownership. + +Three fresh processes, one warmup and three measured passes per process: + +| Workload | Babel | Native before correction | Native after correction | +| ------------------------------------ | ----------: | -----------------------: | ----------------------: | +| Hydrate, 500 boundaries, client | 78.27 ms | 176.65 ms | 52.55 ms | +| Hydrate, 500 boundaries, server | 56.08 ms | 103.62 ms | 36.80 ms | +| Shared destructuring, 1,000 bindings | 4302.65 ms¹ | 410.23 ms | 184.56 ms | + +¹ The Babel destructuring sample is an exploratory single pass; the native +before/after comparison uses the identical repeated configuration. Do not infer +statistical precision from the exploratory Babel ratio. + +Native peak RSS fell from 198.5 to 153.8 MiB for client Hydrate, 160.3 to +123.8 MiB for server Hydrate, and 284.8 to 202.8 MiB for destructuring. Code and +source-map byte totals were unchanged in every before/after sample. Behavioral +tests cover forward spread declarations. Executed-output tests verify that all +destructured getters evaluate exactly once when only the final sibling is used, +while the initializer is removed when no sibling survives. + +Final-source dense checks also passed with matching input hashes. Three fresh +processes, one warmup and three Hydrate compiles per process measured 500-boundary +client compilation at 70.50 → 52.46 ms (265.3 → 153.0 MiB peak RSS), and server +compilation at 46.79 → 36.20 ms (203.3 → 122.5 MiB). With two corpus passes per +process, 1,000 shared destructured bindings measured 3793.85 → 187.40 ms +(354.9 → 166.5 MiB), producing 12 outputs in both engines. These sequential +stress comparisons are recorded in `final-hydrate-*.json` and +`final-bindings-1000-*.json`; they are separate from the alternating main runs. + +## Integration checks + +Final package checks passed for router-utils (45 unit/typechecked tests), +router-generator (261 runtime and 12 fixture type tests), router-plugin (708 +unit tests), start-plugin-core (580 tests), and react-start-rsc (61 tests). +Affected package TypeScript 5.6, 5.7, 5.8, 5.9, 6, and 7 checks, lint, and +package integrity/export checks passed. Router-utils' previously disabled +unit-test script now runs its tests. + +Production browser suites passed for React route splitting (6 tests), Solid +route splitting (5), Vue JSX (22), and Vue SFC (22). After the final Hydrate +index change, production deferred hydration passed for React (16 tests; one +development-only test skipped) and Solid (15). Vite import protection passed +87 integration tests, including development cold/warm analysis and production +output behavior. + +The initial Rsbuild import-protection run stopped at its SSR build with +`RspackResolver(PackagePathNotExported(".", ".../@tanstack/react-start/package.json"))` +in cross-module safe-wrapper fixtures. A public baseline comparison identified +overly broad native candidate detection: an unrelated middleware chain was +being resolved as a possible direct factory. The Babel baseline made zero +resolver calls on that input; the initial native implementation threw. A +failing regression was added, then direct-call eligibility was corrected while +retaining parenthesized namespace support. Package tests and the actual Rsbuild +production build plus all 87 browser tests pass after the fix. + +Server-function production suites pass all 53 tests under both Vite and Rsbuild. +These suites exposed another regression before passing: a server-action provider +retained an originally exported page's initialization graph and evaluated +`window` during server import. Native liveness now counts original export +records as original uses, so deliberately stripped exports can become dead. +This corrects shared ownership rather than special-casing browser globals. +Three public provider regressions cover named variable, named function, and +named default exports. The live Vite HMR suite passed all 28 browser tests, +including state preservation and transitive server-function invalidation. + +## Final stash-workflow checks + +After the supporting commits, implementation changes were stashed for the +BEFORE phase and restored for AFTER. The baseline checkout retained the Babel +compiler; restored native source and executable fingerprints matched those used +for the five alternating measurement pairs. + +The same public HMR export-contract test ran in both phases. Babel passed 8 of +16 cases and failed 8 with automatic route splitting enabled: function, +overloaded function, shared function, variable, multiple variable, default, +class, and explicit alias exports. These tests express intended public export +semantics and reveal preexisting baseline deficiencies; they are not regressions +introduced by Yuku. The restored native compiler passed all 16. Full logs are +`/tmp/yuku-before-contract-tests.log` and `/tmp/yuku-after-contract-tests.log`; +the durable outcome record is +[workflow-contracts.json](benchmarks/compiler/results/workflow-contracts.json). + +The same fixed 52-fixture performance harness was also rerun after stashing and +restoring. Each phase used one fresh process, one warmup and three measured +passes: Babel 358.39 ms per corpus / 384.14 MiB peak RSS, native 109.48 ms / +142.73 MiB. These are workflow smoke checks only, not additional evidence of +statistical precision. Primary conclusions use the five alternating pairs. +Raw records are [workflow-before.json](benchmarks/compiler/results/workflow-before.json) +and [workflow-after.json](benchmarks/compiler/results/workflow-after.json). + +## Initial full client bundle comparison — cleanup pending + +Both phases completed all 18 bundle scenarios with source attribution enabled, +identical scenario selection, and package builds through Nx. The complete +snapshots, including per-file metrics and source attribution, are preserved as +[bundle-before.json](benchmarks/compiler/results/bundle-before.json) and +[bundle-after.json](benchmarks/compiler/results/bundle-after.json). The latter +is the candidate before the pending Hydrate cleanup, not final acceptance data; +an immutable copy is [bundle-after-pre-cleanup.json](benchmarks/compiler/results/bundle-after-pre-cleanup.json). + +Sixteen scenarios have identical raw, gzip, initial raw/gzip, Brotli, initial +Brotli, and JavaScript chunk-count metrics: all six React/Solid/Vue Router +scenarios; React Start minimal, query integration, full, and all three Rsbuild +scenarios; Solid Start minimal/full; and Vue Start minimal/full. + +The two changed scenarios are: + +| Scenario | Raw bytes, before → after | Gzip bytes, before → after | Initial gzip, before → after | Brotli bytes, before → after | JS chunks | +| ------------------------------ | ------------------------: | -------------------------: | ---------------------------: | ---------------------------: | --------: | +| React Start deferred hydration | 309272 → 309337 (+65) | 99248 → 99281 (+33) | 98386 → 98419 (+33) | 86209 → 86231 (+22) | 3 → 3 | +| Solid Start deferred hydration | 144879 → 144944 (+65) | 49997 → 50029 (+32) | 46805 → 46840 (+35) | 44635 → 44696 (+61) | 3 → 3 | + +Initial raw bytes also increase by 65 in each case. Initial Brotli increases +by 14 bytes for React and 58 for Solid. Independent emitted-code review located +unused generated `lazyRouteComponent(..., 'H0')` calls in the eager route chunk +for both increases. Tracing them exposed the upstream JSX reference omission +described below, with broader semantic consequences than these size increases. +There is no local cleanup workaround. Correctness, performance, and all-scenario +bundle checks must be repeated after the upstream fix; these snapshots do not +establish an acceptable final candidate. + +## Upstream findings and platform limits + +The [upstream report](benchmarks/compiler/yuku-feasibility/README.md) contains +small executable reproducers and proposed fixes: + +- **Blocking semantic defect:** standalone JSX names beginning with `_`, `$`, + or Unicode do not receive runtime reference records. The upstream binder's + `binder.zig` handling checks only ASCII `A`–`Z` for standalone JSX names. + For example, `const _Widget = () => 'hello'` used by a route loader and by + `component: () => <_Widget />` should be shared across the separately split + loader/component chunks. Native `computeSharedBindings` instead returns no + shared binding and the component chunk references an unresolved `_Widget`. + `$Widget` also fails; the ordinary `Widget` control is shared correctly. + A public Vite build-and-execute reproduction confirms `ReferenceError` for + `_Widget` and `$Widget`, while the `Widget` control renders an element. + The same reproduction executes all three loaders/components successfully + against the Babel baseline; it checks execution, not shared-function identity. + The runnable companion is + [jsx-prefixed-route-repro.mjs](benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs). + This is reachable public route usage, not only a generated-code corner case. + The upstream fix must align JSX component reference classification with the + language's component/intrinsic-name rules, with `_`, `$`, Unicode, ASCII + component, and lowercase intrinsic regression coverage. The existing green + suites do not cover or negate this known failure. No repository workaround + is authorized or implemented. +- The default `comments: 'some'` policy drops whitespace-padded purity + annotations. The native compiler uses the documented `comments: 'all'` + policy to preserve source comments generally; it does not repair annotations. +- Passing an inconsistent object-method AST to codegen terminates the process + with SIGBUS on macOS arm64. This was caused by an early invalid transform, + which was corrected. The upstream proposal is validation and a diagnostic + at the native boundary; it is invalid-input hardening, not a valid-syntax + migration blocker. + +Native import/analyze/clone/generate smoke checks passed on official Node +20.19.0 and 22.12.0 binaries, alongside workspace validation on Node 24.8.0. +Only macOS arm64 native binaries were executed. Linux GNU/musl and Windows +installation/import checks remain unverified locally. + +## Required before adoption + +1. Obtain a corrected upstream analyzer release with coverage for standalone + JSX component reference classification. Preserve the public split-route + runtime reproduction as a regression; do not add a local analyzer workaround. +2. Update the dependency and rerun affected compiler/package checks and consuming + application suites, including the new binding regression, Hydrate, route + splitting/HMR, and server functions. +3. Repeat identical baseline/native performance and memory workloads, plus all + 18 attributed bundle scenarios. Current improvements and the two Hydrate size + increases are evidence for this candidate, not acceptance of the corrected one. +4. Validate native package installation/import and relevant compiler behavior in + Linux GNU/musl and Windows CI, alongside the already exercised macOS arm64 + and supported Node versions. diff --git a/benchmarks/compiler/README.md b/benchmarks/compiler/README.md index 4f5031b2d5f..33164fc2ce3 100644 --- a/benchmarks/compiler/README.md +++ b/benchmarks/compiler/README.md @@ -1,5 +1,20 @@ # Compiler migration benchmarks +**Adoption is blocked:** Yuku 0.11.0 omits runtime references for standalone JSX +component names beginning with `_`, `$`, or Unicode. A public split-route case +using `_Widget` or `$Widget` in both a loader and component can produce an +unresolved component binding. Existing green suites do not override that known +semantic failure: a public Vite build-and-execute reproduction throws +`ReferenceError` for both names while the `Widget` control renders correctly. +The runnable reproduction is +[`jsx-prefixed-route-repro.mjs`](yuku-feasibility/jsx-prefixed-route-repro.mjs). +No local workaround has been implemented. The implementation +and local evaluation are complete, but the migration is not ready to land until +the upstream analyzer is fixed and correctness, performance, and bundles are +remeasured. Results below preserve current performance evidence pending that fix. +Linux GNU/musl and Windows native-package/compiler CI is also required before +adoption; local execution covered macOS arm64 only. + These local wall-clock measurements separate a Babel/Yuku toolkit feasibility comparison from the complete existing route splitter and actual Vite builds. They are not CodSpeed runtime benchmarks. A faster toolkit roundtrip does not @@ -73,6 +88,11 @@ end. Heap deltas around explicit GC are observations, not attribution of every native allocation; RSS need not fall when the allocator retains freed pages. See `final-cache-*-timing.json` and `final-cache-*-profile.json`. +The cache-clear heap drops above are from the 750-route diagnostic where stated, +with forced GC before and after clearing; they do not isolate native allocation +ownership. The 3.3% difference is an observed median from three speed workers per +variant, not an established statistically reliable benefit. + Final dense-module checks also remain faster and use less peak process memory: | Workload | Babel median ms | Native median ms | Median peak RSS, Babel → native | @@ -93,6 +113,34 @@ the two measured scaling optimizations. The earlier sections below preserve exploratory and optimization measurements; the final paired comparison above is the main adoption evidence. +## Final stash-workflow artifacts + +Supporting commits `0ec43cd02c` and `f69eb7a5aa` preserve tests and measurement +artifacts without changing the baseline compiler. The implementation was then +stashed and restored for the required BEFORE/AFTER checks. Identical public HMR +export-contract tests passed 8/16 cases on Babel and 16/16 on native Yuku. All +eight baseline failures involve automatic route splitting and expose preexisting +public-export deficiencies, not migration regressions. Details and original log +paths are in `results/workflow-contracts.json`. + +`workflow-before.json` and `workflow-after.json` record one fresh process, one +warmup and three corpus passes per phase: 358.39 → 109.48 ms, with peak RSS +384.14 → 142.73 MiB. These are smoke checks for the stash workflow; speed +conclusions use the five alternating pairs above. + +All 18 client bundle scenarios were also measured in both phases with source +attribution enabled. Complete attributed snapshots are preserved unchanged in +`results/bundle-before.json` and `results/bundle-after.json`. The latter is a +pre-cleanup candidate, also retained as `bundle-after-pre-cleanup.json`, not +final acceptance data. Sixteen scenarios +have identical raw, gzip, initial raw/gzip, Brotli, initial Brotli, and chunk-count +metrics. Deferred hydration changes by +65 raw/+33 gzip bytes for React and ++65 raw/+32 gzip for Solid; both remain at three chunks. Independent emitted-code +review found unused generated lazy-route component calls in the eager route +chunks. Tracing those calls exposed the blocking upstream JSX reference defect +above. An upstream fix and final revalidation are pending; the local +`RESULT-optimization-yuku.md` report contains the comparison. + Use the Node version in `.nvmrc` and the root pnpm version. Build both workspaces through Nx before timing: workspace package imports consume `dist`. The default modes benchmark the native compiler; select Babel modes against a baseline checkout. diff --git a/benchmarks/compiler/results/bundle-after-pre-cleanup.json b/benchmarks/compiler/results/bundle-after-pre-cleanup.json new file mode 100644 index 00000000000..a35a329307d --- /dev/null +++ b/benchmarks/compiler/results/bundle-after-pre-cleanup.json @@ -0,0 +1,7320 @@ +{ + "schemaVersion": 1, + "benchmarkName": "Bundle Size (gzip)", + "measuredAt": "2026-09-26T14:48:23.457Z", + "status": { + "state": "success", + "command": "node scripts/benchmarks/bundle-size/measure.mjs --analysis", + "scenarioFilter": null, + "measuredScenarios": [ + "react-router.minimal", + "react-router.full", + "solid-router.minimal", + "solid-router.full", + "vue-router.minimal", + "vue-router.full", + "react-start.minimal", + "react-start.query-integration", + "react-start.deferred-hydration", + "react-start.full", + "react-start.rsbuild.minimal", + "react-start.rsbuild.minimal-iife", + "react-start.rsbuild.full", + "solid-start.minimal", + "solid-start.deferred-hydration", + "solid-start.full", + "vue-start.minimal", + "vue-start.full" + ], + "packageBuildProjects": [ + "@tanstack/react-router", + "@tanstack/react-router-ssr-query", + "@tanstack/react-start", + "@tanstack/router-plugin", + "@tanstack/solid-router", + "@tanstack/solid-start", + "@tanstack/vue-router", + "@tanstack/vue-start" + ], + "skipPackageBuilds": false, + "durationMs": 16428, + "git": { + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "branch": "codex/yuku-evaluation", + "dirty": true + } + }, + "metrics": [ + { + "id": "react-router.minimal", + "scenarioDir": "react-router-minimal", + "outDir": "react-router-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-minimal", + "initialJsFiles": ["assets/index-BwQ9d2Og.js"], + "jsFiles": ["assets/index-BwQ9d2Og.js", "assets/routes-CA20XV3U.js"], + "files": [ + { + "file": "assets/index-BwQ9d2Og.js", + "rawBytes": 267468, + "gzipBytes": 85809, + "brotliBytes": 74747, + "initial": true + }, + { + "file": "assets/routes-CA20XV3U.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 122, + "initial": false + } + ], + "initialRawBytes": 267468, + "initialGzipBytes": 85809, + "initialBrotliBytes": 74747, + "rawBytes": 267602, + "gzipBytes": 85949, + "brotliBytes": 74869, + "sources": [ + { + "file": "assets/index-BwQ9d2Og.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174479 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16339 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15819 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8298 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4546 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4165 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2994 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2389 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1638 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1267 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1214 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 726 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 634 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 586 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 346 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../scenarios/react-router-minimal/src/main.tsx", + "estimatedBytes": 189 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CA20XV3U.js", + "sources": [ + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-router.full", + "scenarioDir": "react-router-full", + "outDir": "react-router-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-full", + "initialJsFiles": ["assets/index-CDUmIUHF.js"], + "jsFiles": ["assets/index-CDUmIUHF.js", "assets/routes-C-otk8PM.js"], + "files": [ + { + "file": "assets/index-CDUmIUHF.js", + "rawBytes": 279638, + "gzipBytes": 89451, + "brotliBytes": 78030, + "initial": true + }, + { + "file": "assets/routes-C-otk8PM.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 279638, + "initialGzipBytes": 89451, + "initialBrotliBytes": 78030, + "rawBytes": 279772, + "gzipBytes": 89591, + "brotliBytes": 78150, + "sources": [ + { + "file": "assets/index-CDUmIUHF.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174520 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16431 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16023 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8293 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4264 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3150 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/__root.tsx", + "estimatedBytes": 2900 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2383 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1600 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1358 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 981 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 412 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 323 + }, + { + "source": "../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 317 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 241 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 214 + }, + { + "source": "../../../scenarios/react-router-full/src/main.tsx", + "estimatedBytes": 210 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/react-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 100 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 61 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 45 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-C-otk8PM.js", + "sources": [ + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "solid-router.minimal", + "scenarioDir": "solid-router-minimal", + "outDir": "solid-router-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-minimal", + "initialJsFiles": ["assets/index-BmrxjeDf.js"], + "jsFiles": ["assets/index-BmrxjeDf.js", "assets/routes-DH7R64WK.js"], + "files": [ + { + "file": "assets/index-BmrxjeDf.js", + "rawBytes": 98160, + "gzipBytes": 34206, + "brotliBytes": 30921, + "initial": true + }, + { + "file": "assets/routes-DH7R64WK.js", + "rawBytes": 115, + "gzipBytes": 123, + "brotliBytes": 90, + "initial": false + } + ], + "initialRawBytes": 98160, + "initialGzipBytes": 34206, + "initialBrotliBytes": 30921, + "rawBytes": 98275, + "gzipBytes": 34329, + "brotliBytes": 31011, + "sources": [ + { + "file": "assets/index-BmrxjeDf.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16344 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15734 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 14919 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11062 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8281 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4541 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4030 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3007 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1680 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1242 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 687 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 652 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 262 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/main.tsx", + "estimatedBytes": 165 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DH7R64WK.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "solid-router.full", + "scenarioDir": "solid-router-full", + "outDir": "solid-router-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-full", + "initialJsFiles": ["assets/index-C-kFm1f4.js"], + "jsFiles": ["assets/index-C-kFm1f4.js", "assets/routes-CmhrXP5a.js"], + "files": [ + { + "file": "assets/index-C-kFm1f4.js", + "rawBytes": 113273, + "gzipBytes": 39221, + "brotliBytes": 35365, + "initial": true + }, + { + "file": "assets/routes-CmhrXP5a.js", + "rawBytes": 115, + "gzipBytes": 126, + "brotliBytes": 115, + "initial": false + } + ], + "initialRawBytes": 113273, + "initialGzipBytes": 39221, + "initialBrotliBytes": 35365, + "rawBytes": 113388, + "gzipBytes": 39347, + "brotliBytes": 35480, + "sources": [ + { + "file": "assets/index-C-kFm1f4.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16423 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16103 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15971 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11064 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8289 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4085 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2729 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/__root.tsx", + "estimatedBytes": 2523 + }, + { + "source": "../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1845 + }, + { + "source": "../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1565 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1428 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 936 + }, + { + "source": "../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 871 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 802 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 568 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 260 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../scenarios/solid-router-full/src/main.tsx", + "estimatedBytes": 186 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 141 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 110 + }, + { + "source": "../../../scenarios/solid-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 87 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-CmhrXP5a.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "vue-router.minimal", + "scenarioDir": "vue-router-minimal", + "outDir": "vue-router-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-minimal", + "initialJsFiles": ["assets/index-Djx-3N0V.js"], + "jsFiles": ["assets/index-Djx-3N0V.js", "assets/routes-B7mXKOrU.js"], + "files": [ + { + "file": "assets/index-Djx-3N0V.js", + "rawBytes": 139908, + "gzipBytes": 50474, + "brotliBytes": 45773, + "initial": true + }, + { + "file": "assets/routes-B7mXKOrU.js", + "rawBytes": 118, + "gzipBytes": 127, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 139908, + "initialGzipBytes": 50474, + "initialBrotliBytes": 45773, + "rawBytes": 140026, + "gzipBytes": 50601, + "brotliBytes": 45893, + "sources": [ + { + "file": "assets/index-Djx-3N0V.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 38333 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15787 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15530 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6191 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5640 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2769 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2173 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2107 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1836 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1208 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 717 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 558 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 546 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/main.tsx", + "estimatedBytes": 206 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 191 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 34 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-B7mXKOrU.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-router.full", + "scenarioDir": "vue-router-full", + "outDir": "vue-router-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-full", + "initialJsFiles": ["assets/index-BklgoVjp.js"], + "jsFiles": ["assets/index-BklgoVjp.js", "assets/routes-YfaVWqqP.js"], + "files": [ + { + "file": "assets/index-BklgoVjp.js", + "rawBytes": 158652, + "gzipBytes": 56237, + "brotliBytes": 50775, + "initial": true + }, + { + "file": "assets/routes-YfaVWqqP.js", + "rawBytes": 118, + "gzipBytes": 125, + "brotliBytes": 117, + "initial": false + } + ], + "initialRawBytes": 158652, + "initialGzipBytes": 56237, + "initialBrotliBytes": 50775, + "rawBytes": 158770, + "gzipBytes": 56362, + "brotliBytes": 50892, + "sources": [ + { + "file": "assets/index-BklgoVjp.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 41262 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16007 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15529 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6352 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5643 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2923 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/__root.tsx", + "estimatedBytes": 2908 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2174 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../scenarios/vue-router-full/src/main.tsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-YfaVWqqP.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "react-start.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-minimal/client", + "initialJsFiles": ["assets/index-CC8_Xydx.js"], + "jsFiles": ["assets/index-CC8_Xydx.js", "assets/routes-CjaFahFe.js"], + "files": [ + { + "file": "assets/index-CC8_Xydx.js", + "rawBytes": 307749, + "gzipBytes": 98365, + "brotliBytes": 85404, + "initial": true + }, + { + "file": "assets/routes-CjaFahFe.js", + "rawBytes": 134, + "gzipBytes": 139, + "brotliBytes": 124, + "initial": false + } + ], + "initialRawBytes": 307749, + "initialGzipBytes": 98365, + "initialBrotliBytes": 85404, + "rawBytes": 307883, + "gzipBytes": 98504, + "brotliBytes": 85528, + "sources": [ + { + "file": "assets/index-CC8_Xydx.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CjaFahFe.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.query-integration", + "scenarioDir": "react-start-query-integration", + "outDir": "react-start-query-integration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "query-integration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-query-integration/client", + "initialJsFiles": ["assets/index-BTf76twS.js"], + "jsFiles": ["assets/index-BTf76twS.js", "assets/routes-Bcx2Ru1b.js"], + "files": [ + { + "file": "assets/index-BTf76twS.js", + "rawBytes": 334984, + "gzipBytes": 105955, + "brotliBytes": 91994, + "initial": true + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 100, + "initial": false + } + ], + "initialRawBytes": 334984, + "initialGzipBytes": 105955, + "initialBrotliBytes": 91994, + "rawBytes": 335118, + "gzipBytes": 106095, + "brotliBytes": 92094, + "sources": [ + { + "file": "assets/index-BTf76twS.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174695 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21884 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/query.js", + "estimatedBytes": 6301 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryClient.js", + "estimatedBytes": 4325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutation.js", + "estimatedBytes": 3371 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/utils.js", + "estimatedBytes": 2883 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2375 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1885 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1860 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js", + "estimatedBytes": 1432 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/__root.tsx", + "estimatedBytes": 1376 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/hydration.js", + "estimatedBytes": 1352 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/retryer.js", + "estimatedBytes": 1247 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js", + "estimatedBytes": 1223 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryCache.js", + "estimatedBytes": 1012 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../packages/router-ssr-query-core/dist/esm/index.js", + "estimatedBytes": 904 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/focusManager.js", + "estimatedBytes": 697 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js", + "estimatedBytes": 616 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 584 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js", + "estimatedBytes": 403 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 347 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/removable.js", + "estimatedBytes": 324 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/subscribable.js", + "estimatedBytes": 278 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router-ssr-query/dist/esm/index.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 203 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 189 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-query@5.102.0_react@19.2.3/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js", + "estimatedBytes": 152 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/router.tsx", + "estimatedBytes": 131 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.deferred-hydration", + "scenarioDir": "react-start-deferred-hydration", + "outDir": "react-start-deferred-hydration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-Ja7E7VmY.js"], + "jsFiles": [ + "assets/index-Ja7E7VmY.js", + "assets/routes-Bifk1zW2.js", + "assets/routes-D4B8EAfc.js" + ], + "files": [ + { + "file": "assets/index-Ja7E7VmY.js", + "rawBytes": 307852, + "gzipBytes": 98419, + "brotliBytes": 85432, + "initial": true + }, + { + "file": "assets/routes-Bifk1zW2.js", + "rawBytes": 1358, + "gzipBytes": 725, + "brotliBytes": 668, + "initial": false + }, + { + "file": "assets/routes-D4B8EAfc.js", + "rawBytes": 127, + "gzipBytes": 137, + "brotliBytes": 131, + "initial": false + } + ], + "initialRawBytes": 307852, + "initialGzipBytes": 98419, + "initialBrotliBytes": 85432, + "rawBytes": 309337, + "gzipBytes": 99281, + "brotliBytes": 86231, + "sources": [ + { + "file": "assets/index-Ja7E7VmY.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 97 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bifk1zW2.js", + "sources": [ + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 951 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 75 + } + ] + }, + { + "file": "assets/routes-D4B8EAfc.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx?tss-hydrate=0_99cca8a6b6", + "estimatedBytes": 77 + } + ] + } + ] + }, + { + "id": "react-start.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-full/client", + "initialJsFiles": ["assets/index-i14Qa-IA.js"], + "jsFiles": ["assets/index-i14Qa-IA.js", "assets/routes-Bw2Py9I6.js"], + "files": [ + { + "file": "assets/index-i14Qa-IA.js", + "rawBytes": 317689, + "gzipBytes": 101605, + "brotliBytes": 88168, + "initial": true + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 105, + "initial": false + } + ], + "initialRawBytes": 317689, + "initialGzipBytes": 101605, + "initialBrotliBytes": 88168, + "rawBytes": 317823, + "gzipBytes": 101745, + "brotliBytes": 88273, + "sources": [ + { + "file": "assets/index-i14Qa-IA.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174707 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21853 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19497 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16445 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7470 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4262 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3487 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 3166 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3102 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2580 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2385 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1602 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1364 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1175 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 728 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 400 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 370 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../packages/react-start/dist/esm/useServerFn.js", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 215 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 134 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 104 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 101 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 70 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 62 + }, + { + "source": "../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 49 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal/client", + "initialJsFiles": ["assets/js/index.9acedf019c.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.9acedf019c.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.9acedf019c.js", + "rawBytes": 318798, + "gzipBytes": 101938, + "brotliBytes": 88036, + "initial": true + } + ], + "initialRawBytes": 318798, + "initialGzipBytes": 101938, + "initialBrotliBytes": 88036, + "rawBytes": 319063, + "gzipBytes": 102153, + "brotliBytes": 88214, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.9acedf019c.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34530 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16430 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 448 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal-iife", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal-iife", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal-iife", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal-iife/client", + "initialJsFiles": ["assets/js/index.04c0c92857.js"], + "jsFiles": [ + "assets/js/async/589.b126e78307.js", + "assets/js/index.04c0c92857.js" + ], + "files": [ + { + "file": "assets/js/async/589.b126e78307.js", + "rawBytes": 230, + "gzipBytes": 211, + "brotliBytes": 177, + "initial": false + }, + { + "file": "assets/js/index.04c0c92857.js", + "rawBytes": 319809, + "gzipBytes": 102360, + "brotliBytes": 88483, + "initial": true + } + ], + "initialRawBytes": 319809, + "initialGzipBytes": 102360, + "initialBrotliBytes": 88483, + "rawBytes": 320039, + "gzipBytes": 102571, + "brotliBytes": 88660, + "sources": [ + { + "file": "assets/js/async/589.b126e78307.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 90 + } + ] + }, + { + "file": "assets/js/index.04c0c92857.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174070 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34544 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16457 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1691 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "webpack://webpack/runtime/jsonp_chunk_loading", + "estimatedBytes": 731 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "webpack://webpack/runtime/load_script", + "estimatedBytes": 656 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-rsbuild-full", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-full/client", + "initialJsFiles": ["assets/js/index.7799b8587d.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.7799b8587d.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.7799b8587d.js", + "rawBytes": 329131, + "gzipBytes": 105267, + "brotliBytes": 90875, + "initial": true + } + ], + "initialRawBytes": 329131, + "initialGzipBytes": 105267, + "initialBrotliBytes": 90875, + "rawBytes": 329396, + "gzipBytes": 105482, + "brotliBytes": 91053, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.7799b8587d.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34535 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4181 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createServerFn.ts", + "estimatedBytes": 3254 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2587 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2525 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 1999 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/react-router/src/useBlocker.tsx", + "estimatedBytes": 1709 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1628 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 1370 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 499 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 447 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../../packages/start-client-core/src/safeObjectMerge.ts", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 367 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/headers.ts", + "estimatedBytes": 346 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 332 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-start/src/useServerFn.ts", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createMiddleware.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 217 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 213 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 195 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouterState.tsx", + "estimatedBytes": 102 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 96 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../../packages/react-router/src/ScrollRestoration.tsx", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/useCanGoBack.ts", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useLocation.tsx", + "estimatedBytes": 63 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/react-router/src/ScriptOnce.tsx", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 32 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "solid-start.minimal", + "scenarioDir": "solid-start-minimal", + "outDir": "solid-start-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "minimal", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-minimal/client", + "initialJsFiles": ["assets/index-CL7q3BCR.js"], + "jsFiles": ["assets/index-CL7q3BCR.js", "assets/routes-telqE5li.js"], + "files": [ + { + "file": "assets/index-CL7q3BCR.js", + "rawBytes": 137217, + "gzipBytes": 46744, + "brotliBytes": 41692, + "initial": true + }, + { + "file": "assets/routes-telqE5li.js", + "rawBytes": 118, + "gzipBytes": 131, + "brotliBytes": 95, + "initial": false + } + ], + "initialRawBytes": 137217, + "initialGzipBytes": 46744, + "initialBrotliBytes": 41692, + "rawBytes": 137335, + "gzipBytes": 46875, + "brotliBytes": 41787, + "sources": [ + { + "file": "assets/index-CL7q3BCR.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21842 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16155 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12218 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4054 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1409 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 705 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-telqE5li.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "solid-start.deferred-hydration", + "scenarioDir": "solid-start-deferred-hydration", + "outDir": "solid-start-deferred-hydration", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-Ikx-VTuF.js"], + "jsFiles": [ + "assets/index-Ikx-VTuF.js", + "assets/routes--V7-k5ry.js", + "assets/routes-D10DOrBF.js" + ], + "files": [ + { + "file": "assets/index-Ikx-VTuF.js", + "rawBytes": 137386, + "gzipBytes": 46840, + "brotliBytes": 41800, + "initial": true + }, + { + "file": "assets/routes--V7-k5ry.js", + "rawBytes": 7442, + "gzipBytes": 3061, + "brotliBytes": 2797, + "initial": false + }, + { + "file": "assets/routes-D10DOrBF.js", + "rawBytes": 116, + "gzipBytes": 128, + "brotliBytes": 99, + "initial": false + } + ], + "initialRawBytes": 137386, + "initialGzipBytes": 46840, + "initialBrotliBytes": 41800, + "rawBytes": 144944, + "gzipBytes": 50029, + "brotliBytes": 44696, + "sources": [ + { + "file": "assets/index-Ikx-VTuF.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16150 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12216 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4050 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1571 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1407 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 802 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 701 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 178 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 97 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes--V7-k5ry.js", + "sources": [ + { + "source": "../../../../../../packages/solid-start-client/dist/esm/GenericHydrate.js", + "estimatedBytes": 2412 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/interaction.js", + "estimatedBytes": 2146 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/runtime.js", + "estimatedBytes": 1448 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/visible.js", + "estimatedBytes": 703 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 123 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 110 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/constants.js", + "estimatedBytes": 91 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/renderer.js", + "estimatedBytes": 47 + } + ] + }, + { + "file": "assets/routes-D10DOrBF.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx?tss-hydrate=0_99cca8a6b6", + "estimatedBytes": 41 + } + ] + } + ] + }, + { + "id": "solid-start.full", + "scenarioDir": "solid-start-full", + "outDir": "solid-start-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "full", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-full/client", + "initialJsFiles": ["assets/index-Dhe0ND7C.js"], + "jsFiles": ["assets/index-Dhe0ND7C.js", "assets/routes-DaGgjiih.js"], + "files": [ + { + "file": "assets/index-Dhe0ND7C.js", + "rawBytes": 152927, + "gzipBytes": 52003, + "brotliBytes": 46190, + "initial": true + }, + { + "file": "assets/routes-DaGgjiih.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 94, + "initial": false + } + ], + "initialRawBytes": 152927, + "initialGzipBytes": 52003, + "initialBrotliBytes": 46190, + "rawBytes": 153045, + "gzipBytes": 52131, + "brotliBytes": 46284, + "sources": [ + { + "file": "assets/index-Dhe0ND7C.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19427 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16428 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16137 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12214 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4098 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/__root.tsx", + "estimatedBytes": 3440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1846 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1430 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 885 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 699 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 618 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 261 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 143 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 66 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DaGgjiih.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "vue-start.minimal", + "scenarioDir": "vue-start-minimal", + "outDir": "vue-start-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "minimal", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-minimal/client", + "initialJsFiles": ["assets/index-Cr54SeNl.js"], + "jsFiles": ["assets/index-Cr54SeNl.js", "assets/routes-cOMmwDsi.js"], + "files": [ + { + "file": "assets/index-Cr54SeNl.js", + "rawBytes": 188874, + "gzipBytes": 66326, + "brotliBytes": 59259, + "initial": true + }, + { + "file": "assets/routes-cOMmwDsi.js", + "rawBytes": 118, + "gzipBytes": 126, + "brotliBytes": 108, + "initial": false + } + ], + "initialRawBytes": 188874, + "initialGzipBytes": 66326, + "initialBrotliBytes": 59259, + "rawBytes": 188992, + "gzipBytes": 66452, + "brotliBytes": 59367, + "sources": [ + { + "file": "assets/index-Cr54SeNl.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15562 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6190 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2148 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1348 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 644 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 536 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-cOMmwDsi.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-start.full", + "scenarioDir": "vue-start-full", + "outDir": "vue-start-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "full", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-full/client", + "initialJsFiles": ["assets/index-CTQXtRLp.js"], + "jsFiles": ["assets/index-CTQXtRLp.js", "assets/routes-BTMh9l3E.js"], + "files": [ + { + "file": "assets/index-CTQXtRLp.js", + "rawBytes": 201482, + "gzipBytes": 70275, + "brotliBytes": 62629, + "initial": true + }, + { + "file": "assets/routes-BTMh9l3E.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 109, + "initial": false + } + ], + "initialRawBytes": 201482, + "initialGzipBytes": 70275, + "initialBrotliBytes": 62629, + "rawBytes": 201600, + "gzipBytes": 70403, + "brotliBytes": 62738, + "sources": [ + { + "file": "assets/index-CTQXtRLp.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21875 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16436 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15561 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6353 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/__root.tsx", + "estimatedBytes": 3181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../../packages/vue-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/vue-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-BTMh9l3E.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + } + ], + "generatedAt": "2026-09-26T14:48:39.895Z", + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd" +} diff --git a/benchmarks/compiler/results/bundle-after.json b/benchmarks/compiler/results/bundle-after.json new file mode 100644 index 00000000000..a35a329307d --- /dev/null +++ b/benchmarks/compiler/results/bundle-after.json @@ -0,0 +1,7320 @@ +{ + "schemaVersion": 1, + "benchmarkName": "Bundle Size (gzip)", + "measuredAt": "2026-09-26T14:48:23.457Z", + "status": { + "state": "success", + "command": "node scripts/benchmarks/bundle-size/measure.mjs --analysis", + "scenarioFilter": null, + "measuredScenarios": [ + "react-router.minimal", + "react-router.full", + "solid-router.minimal", + "solid-router.full", + "vue-router.minimal", + "vue-router.full", + "react-start.minimal", + "react-start.query-integration", + "react-start.deferred-hydration", + "react-start.full", + "react-start.rsbuild.minimal", + "react-start.rsbuild.minimal-iife", + "react-start.rsbuild.full", + "solid-start.minimal", + "solid-start.deferred-hydration", + "solid-start.full", + "vue-start.minimal", + "vue-start.full" + ], + "packageBuildProjects": [ + "@tanstack/react-router", + "@tanstack/react-router-ssr-query", + "@tanstack/react-start", + "@tanstack/router-plugin", + "@tanstack/solid-router", + "@tanstack/solid-start", + "@tanstack/vue-router", + "@tanstack/vue-start" + ], + "skipPackageBuilds": false, + "durationMs": 16428, + "git": { + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "branch": "codex/yuku-evaluation", + "dirty": true + } + }, + "metrics": [ + { + "id": "react-router.minimal", + "scenarioDir": "react-router-minimal", + "outDir": "react-router-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-minimal", + "initialJsFiles": ["assets/index-BwQ9d2Og.js"], + "jsFiles": ["assets/index-BwQ9d2Og.js", "assets/routes-CA20XV3U.js"], + "files": [ + { + "file": "assets/index-BwQ9d2Og.js", + "rawBytes": 267468, + "gzipBytes": 85809, + "brotliBytes": 74747, + "initial": true + }, + { + "file": "assets/routes-CA20XV3U.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 122, + "initial": false + } + ], + "initialRawBytes": 267468, + "initialGzipBytes": 85809, + "initialBrotliBytes": 74747, + "rawBytes": 267602, + "gzipBytes": 85949, + "brotliBytes": 74869, + "sources": [ + { + "file": "assets/index-BwQ9d2Og.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174479 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16339 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15819 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8298 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4546 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4165 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2994 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2389 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1638 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1267 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1214 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 726 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 634 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 586 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 346 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../scenarios/react-router-minimal/src/main.tsx", + "estimatedBytes": 189 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CA20XV3U.js", + "sources": [ + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-router.full", + "scenarioDir": "react-router-full", + "outDir": "react-router-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-full", + "initialJsFiles": ["assets/index-CDUmIUHF.js"], + "jsFiles": ["assets/index-CDUmIUHF.js", "assets/routes-C-otk8PM.js"], + "files": [ + { + "file": "assets/index-CDUmIUHF.js", + "rawBytes": 279638, + "gzipBytes": 89451, + "brotliBytes": 78030, + "initial": true + }, + { + "file": "assets/routes-C-otk8PM.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 279638, + "initialGzipBytes": 89451, + "initialBrotliBytes": 78030, + "rawBytes": 279772, + "gzipBytes": 89591, + "brotliBytes": 78150, + "sources": [ + { + "file": "assets/index-CDUmIUHF.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174520 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16431 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16023 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8293 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4264 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3150 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/__root.tsx", + "estimatedBytes": 2900 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2383 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1600 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1358 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 981 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 412 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 323 + }, + { + "source": "../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 317 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 241 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 214 + }, + { + "source": "../../../scenarios/react-router-full/src/main.tsx", + "estimatedBytes": 210 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/react-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 100 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 61 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 45 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-C-otk8PM.js", + "sources": [ + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "solid-router.minimal", + "scenarioDir": "solid-router-minimal", + "outDir": "solid-router-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-minimal", + "initialJsFiles": ["assets/index-BmrxjeDf.js"], + "jsFiles": ["assets/index-BmrxjeDf.js", "assets/routes-DH7R64WK.js"], + "files": [ + { + "file": "assets/index-BmrxjeDf.js", + "rawBytes": 98160, + "gzipBytes": 34206, + "brotliBytes": 30921, + "initial": true + }, + { + "file": "assets/routes-DH7R64WK.js", + "rawBytes": 115, + "gzipBytes": 123, + "brotliBytes": 90, + "initial": false + } + ], + "initialRawBytes": 98160, + "initialGzipBytes": 34206, + "initialBrotliBytes": 30921, + "rawBytes": 98275, + "gzipBytes": 34329, + "brotliBytes": 31011, + "sources": [ + { + "file": "assets/index-BmrxjeDf.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16344 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15734 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 14919 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11062 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8281 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4541 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4030 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3007 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1680 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1242 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 687 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 652 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 262 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/main.tsx", + "estimatedBytes": 165 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DH7R64WK.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "solid-router.full", + "scenarioDir": "solid-router-full", + "outDir": "solid-router-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-full", + "initialJsFiles": ["assets/index-C-kFm1f4.js"], + "jsFiles": ["assets/index-C-kFm1f4.js", "assets/routes-CmhrXP5a.js"], + "files": [ + { + "file": "assets/index-C-kFm1f4.js", + "rawBytes": 113273, + "gzipBytes": 39221, + "brotliBytes": 35365, + "initial": true + }, + { + "file": "assets/routes-CmhrXP5a.js", + "rawBytes": 115, + "gzipBytes": 126, + "brotliBytes": 115, + "initial": false + } + ], + "initialRawBytes": 113273, + "initialGzipBytes": 39221, + "initialBrotliBytes": 35365, + "rawBytes": 113388, + "gzipBytes": 39347, + "brotliBytes": 35480, + "sources": [ + { + "file": "assets/index-C-kFm1f4.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16423 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16103 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15971 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11064 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8289 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4085 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2729 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/__root.tsx", + "estimatedBytes": 2523 + }, + { + "source": "../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1845 + }, + { + "source": "../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1565 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1428 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 936 + }, + { + "source": "../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 871 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 802 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 568 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 260 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../scenarios/solid-router-full/src/main.tsx", + "estimatedBytes": 186 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 141 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 110 + }, + { + "source": "../../../scenarios/solid-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 87 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-CmhrXP5a.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "vue-router.minimal", + "scenarioDir": "vue-router-minimal", + "outDir": "vue-router-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-minimal", + "initialJsFiles": ["assets/index-Djx-3N0V.js"], + "jsFiles": ["assets/index-Djx-3N0V.js", "assets/routes-B7mXKOrU.js"], + "files": [ + { + "file": "assets/index-Djx-3N0V.js", + "rawBytes": 139908, + "gzipBytes": 50474, + "brotliBytes": 45773, + "initial": true + }, + { + "file": "assets/routes-B7mXKOrU.js", + "rawBytes": 118, + "gzipBytes": 127, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 139908, + "initialGzipBytes": 50474, + "initialBrotliBytes": 45773, + "rawBytes": 140026, + "gzipBytes": 50601, + "brotliBytes": 45893, + "sources": [ + { + "file": "assets/index-Djx-3N0V.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 38333 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15787 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15530 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6191 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5640 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2769 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2173 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2107 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1836 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1208 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 717 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 558 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 546 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/main.tsx", + "estimatedBytes": 206 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 191 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 34 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-B7mXKOrU.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-router.full", + "scenarioDir": "vue-router-full", + "outDir": "vue-router-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-full", + "initialJsFiles": ["assets/index-BklgoVjp.js"], + "jsFiles": ["assets/index-BklgoVjp.js", "assets/routes-YfaVWqqP.js"], + "files": [ + { + "file": "assets/index-BklgoVjp.js", + "rawBytes": 158652, + "gzipBytes": 56237, + "brotliBytes": 50775, + "initial": true + }, + { + "file": "assets/routes-YfaVWqqP.js", + "rawBytes": 118, + "gzipBytes": 125, + "brotliBytes": 117, + "initial": false + } + ], + "initialRawBytes": 158652, + "initialGzipBytes": 56237, + "initialBrotliBytes": 50775, + "rawBytes": 158770, + "gzipBytes": 56362, + "brotliBytes": 50892, + "sources": [ + { + "file": "assets/index-BklgoVjp.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 41262 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16007 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15529 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6352 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5643 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2923 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/__root.tsx", + "estimatedBytes": 2908 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2174 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../scenarios/vue-router-full/src/main.tsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-YfaVWqqP.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "react-start.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-minimal/client", + "initialJsFiles": ["assets/index-CC8_Xydx.js"], + "jsFiles": ["assets/index-CC8_Xydx.js", "assets/routes-CjaFahFe.js"], + "files": [ + { + "file": "assets/index-CC8_Xydx.js", + "rawBytes": 307749, + "gzipBytes": 98365, + "brotliBytes": 85404, + "initial": true + }, + { + "file": "assets/routes-CjaFahFe.js", + "rawBytes": 134, + "gzipBytes": 139, + "brotliBytes": 124, + "initial": false + } + ], + "initialRawBytes": 307749, + "initialGzipBytes": 98365, + "initialBrotliBytes": 85404, + "rawBytes": 307883, + "gzipBytes": 98504, + "brotliBytes": 85528, + "sources": [ + { + "file": "assets/index-CC8_Xydx.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CjaFahFe.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.query-integration", + "scenarioDir": "react-start-query-integration", + "outDir": "react-start-query-integration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "query-integration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-query-integration/client", + "initialJsFiles": ["assets/index-BTf76twS.js"], + "jsFiles": ["assets/index-BTf76twS.js", "assets/routes-Bcx2Ru1b.js"], + "files": [ + { + "file": "assets/index-BTf76twS.js", + "rawBytes": 334984, + "gzipBytes": 105955, + "brotliBytes": 91994, + "initial": true + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 100, + "initial": false + } + ], + "initialRawBytes": 334984, + "initialGzipBytes": 105955, + "initialBrotliBytes": 91994, + "rawBytes": 335118, + "gzipBytes": 106095, + "brotliBytes": 92094, + "sources": [ + { + "file": "assets/index-BTf76twS.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174695 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21884 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/query.js", + "estimatedBytes": 6301 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryClient.js", + "estimatedBytes": 4325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutation.js", + "estimatedBytes": 3371 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/utils.js", + "estimatedBytes": 2883 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2375 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1885 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1860 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js", + "estimatedBytes": 1432 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/__root.tsx", + "estimatedBytes": 1376 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/hydration.js", + "estimatedBytes": 1352 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/retryer.js", + "estimatedBytes": 1247 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js", + "estimatedBytes": 1223 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryCache.js", + "estimatedBytes": 1012 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../packages/router-ssr-query-core/dist/esm/index.js", + "estimatedBytes": 904 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/focusManager.js", + "estimatedBytes": 697 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js", + "estimatedBytes": 616 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 584 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js", + "estimatedBytes": 403 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 347 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/removable.js", + "estimatedBytes": 324 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/subscribable.js", + "estimatedBytes": 278 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router-ssr-query/dist/esm/index.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 203 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 189 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-query@5.102.0_react@19.2.3/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js", + "estimatedBytes": 152 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/router.tsx", + "estimatedBytes": 131 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.deferred-hydration", + "scenarioDir": "react-start-deferred-hydration", + "outDir": "react-start-deferred-hydration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-Ja7E7VmY.js"], + "jsFiles": [ + "assets/index-Ja7E7VmY.js", + "assets/routes-Bifk1zW2.js", + "assets/routes-D4B8EAfc.js" + ], + "files": [ + { + "file": "assets/index-Ja7E7VmY.js", + "rawBytes": 307852, + "gzipBytes": 98419, + "brotliBytes": 85432, + "initial": true + }, + { + "file": "assets/routes-Bifk1zW2.js", + "rawBytes": 1358, + "gzipBytes": 725, + "brotliBytes": 668, + "initial": false + }, + { + "file": "assets/routes-D4B8EAfc.js", + "rawBytes": 127, + "gzipBytes": 137, + "brotliBytes": 131, + "initial": false + } + ], + "initialRawBytes": 307852, + "initialGzipBytes": 98419, + "initialBrotliBytes": 85432, + "rawBytes": 309337, + "gzipBytes": 99281, + "brotliBytes": 86231, + "sources": [ + { + "file": "assets/index-Ja7E7VmY.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 97 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bifk1zW2.js", + "sources": [ + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 951 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 75 + } + ] + }, + { + "file": "assets/routes-D4B8EAfc.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx?tss-hydrate=0_99cca8a6b6", + "estimatedBytes": 77 + } + ] + } + ] + }, + { + "id": "react-start.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-full/client", + "initialJsFiles": ["assets/index-i14Qa-IA.js"], + "jsFiles": ["assets/index-i14Qa-IA.js", "assets/routes-Bw2Py9I6.js"], + "files": [ + { + "file": "assets/index-i14Qa-IA.js", + "rawBytes": 317689, + "gzipBytes": 101605, + "brotliBytes": 88168, + "initial": true + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 105, + "initial": false + } + ], + "initialRawBytes": 317689, + "initialGzipBytes": 101605, + "initialBrotliBytes": 88168, + "rawBytes": 317823, + "gzipBytes": 101745, + "brotliBytes": 88273, + "sources": [ + { + "file": "assets/index-i14Qa-IA.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174707 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21853 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19497 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16445 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7470 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4262 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3487 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 3166 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3102 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2580 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2385 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1602 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1364 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1175 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 728 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 400 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 370 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../packages/react-start/dist/esm/useServerFn.js", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 215 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 134 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 104 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 101 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 70 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 62 + }, + { + "source": "../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 49 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal/client", + "initialJsFiles": ["assets/js/index.9acedf019c.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.9acedf019c.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.9acedf019c.js", + "rawBytes": 318798, + "gzipBytes": 101938, + "brotliBytes": 88036, + "initial": true + } + ], + "initialRawBytes": 318798, + "initialGzipBytes": 101938, + "initialBrotliBytes": 88036, + "rawBytes": 319063, + "gzipBytes": 102153, + "brotliBytes": 88214, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.9acedf019c.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34530 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16430 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 448 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal-iife", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal-iife", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal-iife", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal-iife/client", + "initialJsFiles": ["assets/js/index.04c0c92857.js"], + "jsFiles": [ + "assets/js/async/589.b126e78307.js", + "assets/js/index.04c0c92857.js" + ], + "files": [ + { + "file": "assets/js/async/589.b126e78307.js", + "rawBytes": 230, + "gzipBytes": 211, + "brotliBytes": 177, + "initial": false + }, + { + "file": "assets/js/index.04c0c92857.js", + "rawBytes": 319809, + "gzipBytes": 102360, + "brotliBytes": 88483, + "initial": true + } + ], + "initialRawBytes": 319809, + "initialGzipBytes": 102360, + "initialBrotliBytes": 88483, + "rawBytes": 320039, + "gzipBytes": 102571, + "brotliBytes": 88660, + "sources": [ + { + "file": "assets/js/async/589.b126e78307.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 90 + } + ] + }, + { + "file": "assets/js/index.04c0c92857.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174070 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34544 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16457 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1691 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "webpack://webpack/runtime/jsonp_chunk_loading", + "estimatedBytes": 731 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "webpack://webpack/runtime/load_script", + "estimatedBytes": 656 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-rsbuild-full", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-full/client", + "initialJsFiles": ["assets/js/index.7799b8587d.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.7799b8587d.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.7799b8587d.js", + "rawBytes": 329131, + "gzipBytes": 105267, + "brotliBytes": 90875, + "initial": true + } + ], + "initialRawBytes": 329131, + "initialGzipBytes": 105267, + "initialBrotliBytes": 90875, + "rawBytes": 329396, + "gzipBytes": 105482, + "brotliBytes": 91053, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.7799b8587d.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34535 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4181 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createServerFn.ts", + "estimatedBytes": 3254 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2587 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2525 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 1999 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/react-router/src/useBlocker.tsx", + "estimatedBytes": 1709 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1628 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 1370 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 499 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 447 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../../packages/start-client-core/src/safeObjectMerge.ts", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 367 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/headers.ts", + "estimatedBytes": 346 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 332 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-start/src/useServerFn.ts", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createMiddleware.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 217 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 213 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 195 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouterState.tsx", + "estimatedBytes": 102 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 96 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../../packages/react-router/src/ScrollRestoration.tsx", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/useCanGoBack.ts", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useLocation.tsx", + "estimatedBytes": 63 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/react-router/src/ScriptOnce.tsx", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 32 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "solid-start.minimal", + "scenarioDir": "solid-start-minimal", + "outDir": "solid-start-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "minimal", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-minimal/client", + "initialJsFiles": ["assets/index-CL7q3BCR.js"], + "jsFiles": ["assets/index-CL7q3BCR.js", "assets/routes-telqE5li.js"], + "files": [ + { + "file": "assets/index-CL7q3BCR.js", + "rawBytes": 137217, + "gzipBytes": 46744, + "brotliBytes": 41692, + "initial": true + }, + { + "file": "assets/routes-telqE5li.js", + "rawBytes": 118, + "gzipBytes": 131, + "brotliBytes": 95, + "initial": false + } + ], + "initialRawBytes": 137217, + "initialGzipBytes": 46744, + "initialBrotliBytes": 41692, + "rawBytes": 137335, + "gzipBytes": 46875, + "brotliBytes": 41787, + "sources": [ + { + "file": "assets/index-CL7q3BCR.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21842 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16155 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12218 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4054 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1409 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 705 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-telqE5li.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "solid-start.deferred-hydration", + "scenarioDir": "solid-start-deferred-hydration", + "outDir": "solid-start-deferred-hydration", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-Ikx-VTuF.js"], + "jsFiles": [ + "assets/index-Ikx-VTuF.js", + "assets/routes--V7-k5ry.js", + "assets/routes-D10DOrBF.js" + ], + "files": [ + { + "file": "assets/index-Ikx-VTuF.js", + "rawBytes": 137386, + "gzipBytes": 46840, + "brotliBytes": 41800, + "initial": true + }, + { + "file": "assets/routes--V7-k5ry.js", + "rawBytes": 7442, + "gzipBytes": 3061, + "brotliBytes": 2797, + "initial": false + }, + { + "file": "assets/routes-D10DOrBF.js", + "rawBytes": 116, + "gzipBytes": 128, + "brotliBytes": 99, + "initial": false + } + ], + "initialRawBytes": 137386, + "initialGzipBytes": 46840, + "initialBrotliBytes": 41800, + "rawBytes": 144944, + "gzipBytes": 50029, + "brotliBytes": 44696, + "sources": [ + { + "file": "assets/index-Ikx-VTuF.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16150 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12216 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4050 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1571 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1407 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 802 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 701 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 178 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 97 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes--V7-k5ry.js", + "sources": [ + { + "source": "../../../../../../packages/solid-start-client/dist/esm/GenericHydrate.js", + "estimatedBytes": 2412 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/interaction.js", + "estimatedBytes": 2146 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/runtime.js", + "estimatedBytes": 1448 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/visible.js", + "estimatedBytes": 703 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 123 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 110 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/constants.js", + "estimatedBytes": 91 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/renderer.js", + "estimatedBytes": 47 + } + ] + }, + { + "file": "assets/routes-D10DOrBF.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx?tss-hydrate=0_99cca8a6b6", + "estimatedBytes": 41 + } + ] + } + ] + }, + { + "id": "solid-start.full", + "scenarioDir": "solid-start-full", + "outDir": "solid-start-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "full", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-full/client", + "initialJsFiles": ["assets/index-Dhe0ND7C.js"], + "jsFiles": ["assets/index-Dhe0ND7C.js", "assets/routes-DaGgjiih.js"], + "files": [ + { + "file": "assets/index-Dhe0ND7C.js", + "rawBytes": 152927, + "gzipBytes": 52003, + "brotliBytes": 46190, + "initial": true + }, + { + "file": "assets/routes-DaGgjiih.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 94, + "initial": false + } + ], + "initialRawBytes": 152927, + "initialGzipBytes": 52003, + "initialBrotliBytes": 46190, + "rawBytes": 153045, + "gzipBytes": 52131, + "brotliBytes": 46284, + "sources": [ + { + "file": "assets/index-Dhe0ND7C.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19427 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16428 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16137 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12214 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4098 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/__root.tsx", + "estimatedBytes": 3440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1846 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1430 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 885 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 699 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 618 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 261 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 143 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 66 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DaGgjiih.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "vue-start.minimal", + "scenarioDir": "vue-start-minimal", + "outDir": "vue-start-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "minimal", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-minimal/client", + "initialJsFiles": ["assets/index-Cr54SeNl.js"], + "jsFiles": ["assets/index-Cr54SeNl.js", "assets/routes-cOMmwDsi.js"], + "files": [ + { + "file": "assets/index-Cr54SeNl.js", + "rawBytes": 188874, + "gzipBytes": 66326, + "brotliBytes": 59259, + "initial": true + }, + { + "file": "assets/routes-cOMmwDsi.js", + "rawBytes": 118, + "gzipBytes": 126, + "brotliBytes": 108, + "initial": false + } + ], + "initialRawBytes": 188874, + "initialGzipBytes": 66326, + "initialBrotliBytes": 59259, + "rawBytes": 188992, + "gzipBytes": 66452, + "brotliBytes": 59367, + "sources": [ + { + "file": "assets/index-Cr54SeNl.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15562 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6190 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2148 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1348 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 644 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 536 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-cOMmwDsi.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-start.full", + "scenarioDir": "vue-start-full", + "outDir": "vue-start-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "full", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-full/client", + "initialJsFiles": ["assets/index-CTQXtRLp.js"], + "jsFiles": ["assets/index-CTQXtRLp.js", "assets/routes-BTMh9l3E.js"], + "files": [ + { + "file": "assets/index-CTQXtRLp.js", + "rawBytes": 201482, + "gzipBytes": 70275, + "brotliBytes": 62629, + "initial": true + }, + { + "file": "assets/routes-BTMh9l3E.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 109, + "initial": false + } + ], + "initialRawBytes": 201482, + "initialGzipBytes": 70275, + "initialBrotliBytes": 62629, + "rawBytes": 201600, + "gzipBytes": 70403, + "brotliBytes": 62738, + "sources": [ + { + "file": "assets/index-CTQXtRLp.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21875 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16436 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15561 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6353 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/__root.tsx", + "estimatedBytes": 3181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../../packages/vue-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/vue-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-BTMh9l3E.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + } + ], + "generatedAt": "2026-09-26T14:48:39.895Z", + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd" +} diff --git a/benchmarks/compiler/results/bundle-before.json b/benchmarks/compiler/results/bundle-before.json new file mode 100644 index 00000000000..f2a15506b9b --- /dev/null +++ b/benchmarks/compiler/results/bundle-before.json @@ -0,0 +1,7320 @@ +{ + "schemaVersion": 1, + "benchmarkName": "Bundle Size (gzip)", + "measuredAt": "2026-09-26T14:44:43.187Z", + "status": { + "state": "success", + "command": "node scripts/benchmarks/bundle-size/measure.mjs --analysis", + "scenarioFilter": null, + "measuredScenarios": [ + "react-router.minimal", + "react-router.full", + "solid-router.minimal", + "solid-router.full", + "vue-router.minimal", + "vue-router.full", + "react-start.minimal", + "react-start.query-integration", + "react-start.deferred-hydration", + "react-start.full", + "react-start.rsbuild.minimal", + "react-start.rsbuild.minimal-iife", + "react-start.rsbuild.full", + "solid-start.minimal", + "solid-start.deferred-hydration", + "solid-start.full", + "vue-start.minimal", + "vue-start.full" + ], + "packageBuildProjects": [ + "@tanstack/react-router", + "@tanstack/react-router-ssr-query", + "@tanstack/react-start", + "@tanstack/router-plugin", + "@tanstack/solid-router", + "@tanstack/solid-start", + "@tanstack/vue-router", + "@tanstack/vue-start" + ], + "skipPackageBuilds": false, + "durationMs": 16217, + "git": { + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "branch": "", + "dirty": false + } + }, + "metrics": [ + { + "id": "react-router.minimal", + "scenarioDir": "react-router-minimal", + "outDir": "react-router-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-minimal", + "initialJsFiles": ["assets/index-BwQ9d2Og.js"], + "jsFiles": ["assets/index-BwQ9d2Og.js", "assets/routes-CA20XV3U.js"], + "files": [ + { + "file": "assets/index-BwQ9d2Og.js", + "rawBytes": 267468, + "gzipBytes": 85809, + "brotliBytes": 74747, + "initial": true + }, + { + "file": "assets/routes-CA20XV3U.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 122, + "initial": false + } + ], + "initialRawBytes": 267468, + "initialGzipBytes": 85809, + "initialBrotliBytes": 74747, + "rawBytes": 267602, + "gzipBytes": 85949, + "brotliBytes": 74869, + "sources": [ + { + "file": "assets/index-BwQ9d2Og.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174479 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16339 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15819 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8298 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4546 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4165 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2994 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2389 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1638 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1267 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1214 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 726 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 634 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 586 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 346 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../scenarios/react-router-minimal/src/main.tsx", + "estimatedBytes": 189 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CA20XV3U.js", + "sources": [ + { + "source": "../../../scenarios/react-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-router.full", + "scenarioDir": "react-router-full", + "outDir": "react-router-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-router-full", + "initialJsFiles": ["assets/index-CDUmIUHF.js"], + "jsFiles": ["assets/index-CDUmIUHF.js", "assets/routes-C-otk8PM.js"], + "files": [ + { + "file": "assets/index-CDUmIUHF.js", + "rawBytes": 279638, + "gzipBytes": 89451, + "brotliBytes": 78030, + "initial": true + }, + { + "file": "assets/routes-C-otk8PM.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 279638, + "initialGzipBytes": 89451, + "initialBrotliBytes": 78030, + "rawBytes": 279772, + "gzipBytes": 89591, + "brotliBytes": 78150, + "sources": [ + { + "file": "assets/index-CDUmIUHF.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174520 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16431 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16023 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8293 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4264 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3150 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/__root.tsx", + "estimatedBytes": 2900 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2383 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1600 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1358 + }, + { + "source": "../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 981 + }, + { + "source": "../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 439 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 412 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 323 + }, + { + "source": "../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 317 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 241 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 227 + }, + { + "source": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 214 + }, + { + "source": "../../../scenarios/react-router-full/src/main.tsx", + "estimatedBytes": 210 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/react-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 100 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 61 + }, + { + "source": "../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 45 + }, + { + "source": "../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-C-otk8PM.js", + "sources": [ + { + "source": "../../../scenarios/react-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "solid-router.minimal", + "scenarioDir": "solid-router-minimal", + "outDir": "solid-router-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-minimal", + "initialJsFiles": ["assets/index-BmrxjeDf.js"], + "jsFiles": ["assets/index-BmrxjeDf.js", "assets/routes-DH7R64WK.js"], + "files": [ + { + "file": "assets/index-BmrxjeDf.js", + "rawBytes": 98160, + "gzipBytes": 34206, + "brotliBytes": 30921, + "initial": true + }, + { + "file": "assets/routes-DH7R64WK.js", + "rawBytes": 115, + "gzipBytes": 123, + "brotliBytes": 90, + "initial": false + } + ], + "initialRawBytes": 98160, + "initialGzipBytes": 34206, + "initialBrotliBytes": 30921, + "rawBytes": 98275, + "gzipBytes": 34329, + "brotliBytes": 31011, + "sources": [ + { + "file": "assets/index-BmrxjeDf.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16344 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15734 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 14919 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11062 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8281 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4541 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4030 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3007 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1680 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1242 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 687 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 652 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 262 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/main.tsx", + "estimatedBytes": 165 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DH7R64WK.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "solid-router.full", + "scenarioDir": "solid-router-full", + "outDir": "solid-router-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-router-full", + "initialJsFiles": ["assets/index-C-kFm1f4.js"], + "jsFiles": ["assets/index-C-kFm1f4.js", "assets/routes-CmhrXP5a.js"], + "files": [ + { + "file": "assets/index-C-kFm1f4.js", + "rawBytes": 113273, + "gzipBytes": 39221, + "brotliBytes": 35365, + "initial": true + }, + { + "file": "assets/routes-CmhrXP5a.js", + "rawBytes": 115, + "gzipBytes": 126, + "brotliBytes": 115, + "initial": false + } + ], + "initialRawBytes": 113273, + "initialGzipBytes": 39221, + "initialBrotliBytes": 35365, + "rawBytes": 113388, + "gzipBytes": 39347, + "brotliBytes": 35480, + "sources": [ + { + "file": "assets/index-C-kFm1f4.js", + "sources": [ + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16423 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16103 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15971 + }, + { + "source": "../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 11064 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8289 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4085 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2729 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/__root.tsx", + "estimatedBytes": 2523 + }, + { + "source": "../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1845 + }, + { + "source": "../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1644 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1565 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1428 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 936 + }, + { + "source": "../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 871 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 802 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 568 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 415 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 260 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../scenarios/solid-router-full/src/main.tsx", + "estimatedBytes": 186 + }, + { + "source": "../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 141 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 110 + }, + { + "source": "../../../scenarios/solid-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 87 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-CmhrXP5a.js", + "sources": [ + { + "source": "../../../scenarios/solid-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 47 + } + ] + } + ] + }, + { + "id": "vue-router.minimal", + "scenarioDir": "vue-router-minimal", + "outDir": "vue-router-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "minimal", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-minimal", + "initialJsFiles": ["assets/index-Djx-3N0V.js"], + "jsFiles": ["assets/index-Djx-3N0V.js", "assets/routes-B7mXKOrU.js"], + "files": [ + { + "file": "assets/index-Djx-3N0V.js", + "rawBytes": 139908, + "gzipBytes": 50474, + "brotliBytes": 45773, + "initial": true + }, + { + "file": "assets/routes-B7mXKOrU.js", + "rawBytes": 118, + "gzipBytes": 127, + "brotliBytes": 120, + "initial": false + } + ], + "initialRawBytes": 139908, + "initialGzipBytes": 50474, + "initialBrotliBytes": 45773, + "rawBytes": 140026, + "gzipBytes": 50601, + "brotliBytes": 45893, + "sources": [ + { + "file": "assets/index-Djx-3N0V.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 38333 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 15787 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15530 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6191 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5640 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2769 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2173 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2107 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1836 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/__root.tsx", + "estimatedBytes": 1245 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1208 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 717 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 558 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 546 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/main.tsx", + "estimatedBytes": 206 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 191 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 34 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-B7mXKOrU.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-router.full", + "scenarioDir": "vue-router-full", + "outDir": "vue-router-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-router", + "case": "full", + "entryKey": "index.html", + "manifestPath": ".vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-router-full", + "initialJsFiles": ["assets/index-BklgoVjp.js"], + "jsFiles": ["assets/index-BklgoVjp.js", "assets/routes-YfaVWqqP.js"], + "files": [ + { + "file": "assets/index-BklgoVjp.js", + "rawBytes": 158652, + "gzipBytes": 56237, + "brotliBytes": 50775, + "initial": true + }, + { + "file": "assets/routes-YfaVWqqP.js", + "rawBytes": 118, + "gzipBytes": 125, + "brotliBytes": 117, + "initial": false + } + ], + "initialRawBytes": 158652, + "initialGzipBytes": 56237, + "initialBrotliBytes": 50775, + "rawBytes": 158770, + "gzipBytes": 56362, + "brotliBytes": 50892, + "sources": [ + { + "file": "assets/index-BklgoVjp.js", + "sources": [ + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 41262 + }, + { + "source": "../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 16007 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15529 + }, + { + "source": "../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6352 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5643 + }, + { + "source": "../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2923 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/__root.tsx", + "estimatedBytes": 2908 + }, + { + "source": "../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2174 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchMiddleware.js", + "estimatedBytes": 970 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 296 + }, + { + "source": "../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../scenarios/vue-router-full/src/main.tsx", + "estimatedBytes": 227 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../scenarios/vue-router-full/src/routeTree.gen.ts", + "estimatedBytes": 104 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-YfaVWqqP.js", + "sources": [ + { + "source": "../../../scenarios/vue-router-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "react-start.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-minimal", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-minimal/client", + "initialJsFiles": ["assets/index-CC8_Xydx.js"], + "jsFiles": ["assets/index-CC8_Xydx.js", "assets/routes-CjaFahFe.js"], + "files": [ + { + "file": "assets/index-CC8_Xydx.js", + "rawBytes": 307749, + "gzipBytes": 98365, + "brotliBytes": 85404, + "initial": true + }, + { + "file": "assets/routes-CjaFahFe.js", + "rawBytes": 134, + "gzipBytes": 139, + "brotliBytes": 124, + "initial": false + } + ], + "initialRawBytes": 307749, + "initialGzipBytes": 98365, + "initialBrotliBytes": 85404, + "rawBytes": 307883, + "gzipBytes": 98504, + "brotliBytes": 85528, + "sources": [ + { + "file": "assets/index-CC8_Xydx.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-CjaFahFe.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.query-integration", + "scenarioDir": "react-start-query-integration", + "outDir": "react-start-query-integration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "query-integration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-query-integration/client", + "initialJsFiles": ["assets/index-BTf76twS.js"], + "jsFiles": ["assets/index-BTf76twS.js", "assets/routes-Bcx2Ru1b.js"], + "files": [ + { + "file": "assets/index-BTf76twS.js", + "rawBytes": 334984, + "gzipBytes": 105955, + "brotliBytes": 91994, + "initial": true + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 100, + "initial": false + } + ], + "initialRawBytes": 334984, + "initialGzipBytes": 105955, + "initialBrotliBytes": 91994, + "rawBytes": 335118, + "gzipBytes": 106095, + "brotliBytes": 92094, + "sources": [ + { + "file": "assets/index-BTf76twS.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174695 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21884 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/query.js", + "estimatedBytes": 6301 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryClient.js", + "estimatedBytes": 4325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutation.js", + "estimatedBytes": 3371 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/utils.js", + "estimatedBytes": 2883 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2375 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1885 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1860 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js", + "estimatedBytes": 1432 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/__root.tsx", + "estimatedBytes": 1376 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/hydration.js", + "estimatedBytes": 1352 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/retryer.js", + "estimatedBytes": 1247 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js", + "estimatedBytes": 1223 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/queryCache.js", + "estimatedBytes": 1012 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../packages/router-ssr-query-core/dist/esm/index.js", + "estimatedBytes": 904 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 727 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/focusManager.js", + "estimatedBytes": 697 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js", + "estimatedBytes": 616 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 584 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js", + "estimatedBytes": 403 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 347 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/removable.js", + "estimatedBytes": 324 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/subscribable.js", + "estimatedBytes": 278 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router-ssr-query/dist/esm/index.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 203 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 189 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-query@5.102.0_react@19.2.3/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js", + "estimatedBytes": 152 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/router.tsx", + "estimatedBytes": 131 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+query-core@5.102.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js", + "estimatedBytes": 81 + }, + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bcx2Ru1b.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-query-integration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.deferred-hydration", + "scenarioDir": "react-start-deferred-hydration", + "outDir": "react-start-deferred-hydration", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-DYPtLH8O.js"], + "jsFiles": [ + "assets/index-DYPtLH8O.js", + "assets/routes-Cp0LIpUD.js", + "assets/routes-cIaRJDMf.js" + ], + "files": [ + { + "file": "assets/index-DYPtLH8O.js", + "rawBytes": 307787, + "gzipBytes": 98386, + "brotliBytes": 85418, + "initial": true + }, + { + "file": "assets/routes-Cp0LIpUD.js", + "rawBytes": 127, + "gzipBytes": 138, + "brotliBytes": 124, + "initial": false + }, + { + "file": "assets/routes-cIaRJDMf.js", + "rawBytes": 1358, + "gzipBytes": 724, + "brotliBytes": 667, + "initial": false + } + ], + "initialRawBytes": 307787, + "initialGzipBytes": 98386, + "initialBrotliBytes": 85418, + "rawBytes": 309272, + "gzipBytes": 99248, + "brotliBytes": 86209, + "sources": [ + { + "file": "assets/index-DYPtLH8O.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174694 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21882 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19489 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8299 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7466 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4166 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3484 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3161 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2579 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2387 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1603 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1375 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1172 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 940 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 441 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 401 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 369 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 264 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 138 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 105 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 69 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Cp0LIpUD.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 57 + } + ] + }, + { + "file": "assets/routes-cIaRJDMf.js", + "sources": [ + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 951 + }, + { + "source": "../../../../scenarios/react-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 75 + } + ] + } + ] + }, + { + "id": "react-start.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-full", + "toolchain": "vite", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-full/client", + "initialJsFiles": ["assets/index-i14Qa-IA.js"], + "jsFiles": ["assets/index-i14Qa-IA.js", "assets/routes-Bw2Py9I6.js"], + "files": [ + { + "file": "assets/index-i14Qa-IA.js", + "rawBytes": 317689, + "gzipBytes": 101605, + "brotliBytes": 88168, + "initial": true + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "rawBytes": 134, + "gzipBytes": 140, + "brotliBytes": 105, + "initial": false + } + ], + "initialRawBytes": 317689, + "initialGzipBytes": 101605, + "initialBrotliBytes": 88168, + "rawBytes": 317823, + "gzipBytes": 101745, + "brotliBytes": 88273, + "sources": [ + { + "file": "assets/index-i14Qa-IA.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174707 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21853 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19497 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16445 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7470 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/link.js", + "estimatedBytes": 4262 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3487 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3249 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 3166 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3102 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2580 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Match.js", + "estimatedBytes": 2385 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Asset.js", + "estimatedBytes": 1975 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1861 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useBlocker.js", + "estimatedBytes": 1704 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1602 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Matches.js", + "estimatedBytes": 1364 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1271 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1175 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/route.js", + "estimatedBytes": 936 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 776 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 729 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Transitioner.js", + "estimatedBytes": 728 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 675 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/Scripts.js", + "estimatedBytes": 400 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 370 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useMatch.js", + "estimatedBytes": 348 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/not-found.js", + "estimatedBytes": 343 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 340 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/RouterProvider.js", + "estimatedBytes": 325 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/awaited.js", + "estimatedBytes": 319 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../packages/react-start/dist/esm/useServerFn.js", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 225 + }, + { + "source": "../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 216 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useNavigate.js", + "estimatedBytes": 215 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useParams.js", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ClientOnly.js", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/HeadContent.js", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useSearch.js", + "estimatedBytes": 167 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderData.js", + "estimatedBytes": 149 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/StartClient.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 134 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 104 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouterState.js", + "estimatedBytes": 101 + }, + { + "source": "../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 100 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 70 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/SafeFragment.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useLocation.js", + "estimatedBytes": 62 + }, + { + "source": "../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/matchContext.js", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../packages/react-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 49 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/utils.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 39 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/useRouter.js", + "estimatedBytes": 38 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/react-router/dist/esm/routerContext.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 20 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + } + ] + }, + { + "file": "assets/routes-Bw2Py9I6.js", + "sources": [ + { + "source": "../../../../scenarios/react-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 84 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal/client", + "initialJsFiles": ["assets/js/index.9acedf019c.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.9acedf019c.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.9acedf019c.js", + "rawBytes": 318798, + "gzipBytes": 101938, + "brotliBytes": 88036, + "initial": true + } + ], + "initialRawBytes": 318798, + "initialGzipBytes": 101938, + "initialBrotliBytes": 88036, + "rawBytes": 319063, + "gzipBytes": 102153, + "brotliBytes": 88214, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.9acedf019c.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34530 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16430 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 448 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.minimal-iife", + "scenarioDir": "react-start-minimal", + "outDir": "react-start-rsbuild-minimal-iife", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "minimal-iife", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-minimal-iife/client", + "initialJsFiles": ["assets/js/index.04c0c92857.js"], + "jsFiles": [ + "assets/js/async/589.b126e78307.js", + "assets/js/index.04c0c92857.js" + ], + "files": [ + { + "file": "assets/js/async/589.b126e78307.js", + "rawBytes": 230, + "gzipBytes": 211, + "brotliBytes": 177, + "initial": false + }, + { + "file": "assets/js/index.04c0c92857.js", + "rawBytes": 319809, + "gzipBytes": 102360, + "brotliBytes": 88483, + "initial": true + } + ], + "initialRawBytes": 319809, + "initialGzipBytes": 102360, + "initialBrotliBytes": 88483, + "rawBytes": 320039, + "gzipBytes": 102571, + "brotliBytes": 88660, + "sources": [ + { + "file": "assets/js/async/589.b126e78307.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 90 + } + ] + }, + { + "file": "assets/js/index.04c0c92857.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174070 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34544 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16457 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4101 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2584 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2362 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1691 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1620 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "webpack://webpack/runtime/jsonp_chunk_loading", + "estimatedBytes": 731 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "webpack://webpack/runtime/load_script", + "estimatedBytes": 656 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 587 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 363 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 327 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 317 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 193 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 191 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 184 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 182 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 112 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 103 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-minimal/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "react-start.rsbuild.full", + "scenarioDir": "react-start-full", + "outDir": "react-start-rsbuild-full", + "toolchain": "rsbuild", + "framework": "react", + "packageName": "@tanstack/react-start", + "case": "full", + "entryKey": "index", + "manifestPath": "client/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/react-start-rsbuild-full/client", + "initialJsFiles": ["assets/js/index.7799b8587d.js"], + "jsFiles": [ + "assets/js/async/589.2e1275ece9.js", + "assets/js/index.7799b8587d.js" + ], + "files": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "rawBytes": 265, + "gzipBytes": 215, + "brotliBytes": 178, + "initial": false + }, + { + "file": "assets/js/index.7799b8587d.js", + "rawBytes": 329131, + "gzipBytes": 105267, + "brotliBytes": 90875, + "initial": true + } + ], + "initialRawBytes": 329131, + "initialGzipBytes": 105267, + "initialBrotliBytes": 90875, + "rawBytes": 329396, + "gzipBytes": 105482, + "brotliBytes": 91053, + "sources": [ + { + "file": "assets/js/async/589.2e1275ece9.js", + "sources": [ + { + "source": "../../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 88 + } + ] + }, + { + "file": "assets/js/index.7799b8587d.js", + "sources": [ + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom-client.production.js", + "estimatedBytes": 174048 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 34535 + }, + { + "source": "../../../../../../../packages/router-core/src/load-client.ts", + "estimatedBytes": 19548 + }, + { + "source": "../../../../../../../packages/router-core/src/router.ts", + "estimatedBytes": 16433 + }, + { + "source": "../../../../../../../packages/router-core/src/new-process-route-tree.ts", + "estimatedBytes": 8630 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react.production.js", + "estimatedBytes": 7390 + }, + { + "source": "../../../../../../../packages/history/src/index.ts", + "estimatedBytes": 4572 + }, + { + "source": "../../../../../../../packages/react-router/src/link.tsx", + "estimatedBytes": 4181 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js", + "estimatedBytes": 3443 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createServerFn.ts", + "estimatedBytes": 3254 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js", + "estimatedBytes": 3250 + }, + { + "source": "../../../../../../../packages/router-core/src/utils.ts", + "estimatedBytes": 3122 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/serverFnFetcher.ts", + "estimatedBytes": 2587 + }, + { + "source": "../../../../../../../packages/router-core/src/scroll-restoration.ts", + "estimatedBytes": 2525 + }, + { + "source": "../../../../../../../packages/react-router/src/Match.tsx", + "estimatedBytes": 2390 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/frame-decoder.ts", + "estimatedBytes": 2183 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/__root.tsx", + "estimatedBytes": 1999 + }, + { + "source": "../../../../../../../packages/react-router/src/Asset.tsx", + "estimatedBytes": 1983 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1853 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1789 + }, + { + "source": "../../../../../../../packages/react-router/src/useBlocker.tsx", + "estimatedBytes": 1709 + }, + { + "source": "../../../../../../../packages/router-core/src/path.ts", + "estimatedBytes": 1701 + }, + { + "source": "../../../../../../../packages/react-router/src/headContentUtils.tsx", + "estimatedBytes": 1628 + }, + { + "source": "../../../../../../../packages/react-router/src/Matches.tsx", + "estimatedBytes": 1370 + }, + { + "source": "../../../../../../../packages/react-router/src/CatchBoundary.tsx", + "estimatedBytes": 1275 + }, + { + "source": "../../../../../../../packages/router-core/src/route.ts", + "estimatedBytes": 1215 + }, + { + "source": "../../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1105 + }, + { + "source": "../../../../../../../packages/react-router/src/route.tsx", + "estimatedBytes": 882 + }, + { + "source": "../../../../../../../packages/react-router/src/Transitioner.tsx", + "estimatedBytes": 773 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", + "estimatedBytes": 766 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../../packages/router-core/src/rewrite.ts", + "estimatedBytes": 677 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/rawStreamCodec.ts", + "estimatedBytes": 654 + }, + { + "source": "../../../../../../../packages/router-core/src/stores.ts", + "estimatedBytes": 642 + }, + { + "source": "../../../../../../../packages/router-core/src/searchParams.ts", + "estimatedBytes": 507 + }, + { + "source": "../../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 499 + }, + { + "source": "../../../../../../../packages/router-core/src/manifest.ts", + "estimatedBytes": 480 + }, + { + "source": "webpack://webpack/runtime/module_chunk_loading", + "estimatedBytes": 447 + }, + { + "source": "../../../../../../../packages/router-core/src/qss.ts", + "estimatedBytes": 443 + }, + { + "source": "../../../../../../../packages/react-router/src/lazyRouteComponent.tsx", + "estimatedBytes": 408 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/bodyScripts.ts", + "estimatedBytes": 398 + }, + { + "source": "../../../../../../../packages/router-core/src/redirect.ts", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../../packages/start-client-core/src/safeObjectMerge.ts", + "estimatedBytes": 379 + }, + { + "source": "../../../../../../../packages/react-router/src/Scripts.tsx", + "estimatedBytes": 367 + }, + { + "source": "../../../../../../../packages/router-core/src/sieve-cache.ts", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../../packages/react-router/src/not-found.tsx", + "estimatedBytes": 351 + }, + { + "source": "../../../../../../../packages/react-router/src/useMatch.tsx", + "estimatedBytes": 349 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/headers.ts", + "estimatedBytes": 346 + }, + { + "source": "../../../../../../../packages/react-router/src/RouterProvider.tsx", + "estimatedBytes": 339 + }, + { + "source": "../../../../../../../packages/react-router/src/awaited.tsx", + "estimatedBytes": 332 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js", + "estimatedBytes": 328 + }, + { + "source": "../../../../../../../packages/react-start/src/useServerFn.ts", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/ShallowErrorPlugin.ts", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/makeSerovalPlugin.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/createMiddleware.ts", + "estimatedBytes": 293 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/hydrateStart.ts", + "estimatedBytes": 282 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamJSONPlugin.ts", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../packages/react-router/src/ClientOnly.tsx", + "estimatedBytes": 272 + }, + { + "source": "../../../../../../../node_modules/.pnpm/@tanstack+react-store@0.11.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@tanstack/react-store/dist/useSelector.js", + "estimatedBytes": 242 + }, + { + "source": "../../../../../../../packages/react-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 239 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js", + "estimatedBytes": 224 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js", + "estimatedBytes": 222 + }, + { + "source": "../../../../../../../packages/react-router/src/useNavigate.tsx", + "estimatedBytes": 217 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client-rpc/createClientRpc.ts", + "estimatedBytes": 213 + }, + { + "source": "../../../../../../../packages/react-router/src/useParams.tsx", + "estimatedBytes": 207 + }, + { + "source": "../../../../../../../packages/react-router/src/renderRouteNotFound.tsx", + "estimatedBytes": 205 + }, + { + "source": "../../../../../../../packages/router-core/src/defer.ts", + "estimatedBytes": 204 + }, + { + "source": "../../../../../../../packages/start-client-core/src/client/ServerFunctionSerializationAdapter.ts", + "estimatedBytes": 195 + }, + { + "source": "../../../../../../../packages/react-router/src/HeadContent.tsx", + "estimatedBytes": 194 + }, + { + "source": "../../../../../../../packages/react-router/src/useSearch.tsx", + "estimatedBytes": 167 + }, + { + "source": "webpack://webpack/runtime/make_namespace_object", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderData.tsx", + "estimatedBytes": 149 + }, + { + "source": "webpack://webpack/runtime/define_property_getters", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../../packages/react-start-client/src/StartClient.tsx", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStreamRPCPlugin.ts", + "estimatedBytes": 116 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routeTree.gen.ts", + "estimatedBytes": 108 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouterState.tsx", + "estimatedBytes": 102 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/ssr-match-id.ts", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../../packages/start-client-core/src/constants.ts", + "estimatedBytes": 96 + }, + { + "source": "../../../../../../../packages/react-router/src/useLoaderDeps.tsx", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 90 + }, + { + "source": "../../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../../packages/react-router/src/ScrollRestoration.tsx", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouteContext.ts", + "estimatedBytes": 82 + }, + { + "source": "../../../../../../../packages/start-client-core/src/getDefaultSerovalPlugins.ts", + "estimatedBytes": 81 + }, + { + "source": "webpack://webpack/runtime/ensure_chunk", + "estimatedBytes": 78 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/RawStream.ts", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../../packages/react-router/src/useCanGoBack.ts", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../../packages/react-router/src/routerStores.ts", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../../packages/react-router/src/SafeFragment.tsx", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../../packages/react-router/src/useLocation.tsx", + "estimatedBytes": 63 + }, + { + "source": "../../../../../../../packages/react-router/src/useRouter.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../scenarios/react-start-full/src/routes/index.tsx", + "estimatedBytes": 58 + }, + { + "source": "../../../../../../../packages/react-router/src/router.ts", + "estimatedBytes": 56 + }, + { + "source": "../../../../../../../packages/react-router/src/matchContext.tsx", + "estimatedBytes": 54 + }, + { + "source": "webpack://webpack/runtime/has_own_property", + "estimatedBytes": 53 + }, + { + "source": "../../../../../../../packages/router-core/src/ssr/serializer/seroval-plugins.ts", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/react-router/src/ScriptOnce.tsx", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../../packages/router-core/src/invariant.ts", + "estimatedBytes": 46 + }, + { + "source": "webpack://webpack/runtime/get javascript chunk filename", + "estimatedBytes": 45 + }, + { + "source": "../../../../../../../packages/router-core/src/not-found.ts", + "estimatedBytes": 41 + }, + { + "source": "../../../../../scenarios/react-start-full/src/router.tsx", + "estimatedBytes": 37 + }, + { + "source": "../../../../../../../packages/react-router/src/utils.ts", + "estimatedBytes": 34 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/with-selector.js", + "estimatedBytes": 32 + }, + { + "source": "../../../../../../../packages/react-start-client/src/hydrateStart.ts", + "estimatedBytes": 30 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../packages/router-core/src/link.ts", + "estimatedBytes": 29 + }, + { + "source": "../../../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js", + "estimatedBytes": 27 + }, + { + "source": "webpack://webpack/runtime/get mini-css chunk filename", + "estimatedBytes": 26 + }, + { + "source": "../../../../../../../packages/react-router/src/routerContext.tsx", + "estimatedBytes": 25 + }, + { + "source": "../../../../../../../packages/react-router/src/fileRoute.ts", + "estimatedBytes": 22 + }, + { + "source": "../../../../../../../packages/router-core/src/root.ts", + "estimatedBytes": 14 + }, + { + "source": "webpack://webpack/runtime/public_path", + "estimatedBytes": 8 + } + ] + } + ] + }, + { + "id": "solid-start.minimal", + "scenarioDir": "solid-start-minimal", + "outDir": "solid-start-minimal", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "minimal", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-minimal/client", + "initialJsFiles": ["assets/index-CL7q3BCR.js"], + "jsFiles": ["assets/index-CL7q3BCR.js", "assets/routes-telqE5li.js"], + "files": [ + { + "file": "assets/index-CL7q3BCR.js", + "rawBytes": 137217, + "gzipBytes": 46744, + "brotliBytes": 41692, + "initial": true + }, + { + "file": "assets/routes-telqE5li.js", + "rawBytes": 118, + "gzipBytes": 131, + "brotliBytes": 95, + "initial": false + } + ], + "initialRawBytes": 137217, + "initialGzipBytes": 46744, + "initialBrotliBytes": 41692, + "rawBytes": 137335, + "gzipBytes": 46875, + "brotliBytes": 41787, + "sources": [ + { + "file": "assets/index-CL7q3BCR.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21842 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16155 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12218 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4054 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1409 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 705 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 73 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-telqE5li.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "solid-start.deferred-hydration", + "scenarioDir": "solid-start-deferred-hydration", + "outDir": "solid-start-deferred-hydration", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "deferred-hydration", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-deferred-hydration/client", + "initialJsFiles": ["assets/index-BWTHmDz7.js"], + "jsFiles": [ + "assets/index-BWTHmDz7.js", + "assets/routes-C_W09Kf9.js", + "assets/routes-Cn5ISO0Z.js" + ], + "files": [ + { + "file": "assets/index-BWTHmDz7.js", + "rawBytes": 137321, + "gzipBytes": 46805, + "brotliBytes": 41742, + "initial": true + }, + { + "file": "assets/routes-C_W09Kf9.js", + "rawBytes": 7442, + "gzipBytes": 3063, + "brotliBytes": 2797, + "initial": false + }, + { + "file": "assets/routes-Cn5ISO0Z.js", + "rawBytes": 116, + "gzipBytes": 129, + "brotliBytes": 96, + "initial": false + } + ], + "initialRawBytes": 137321, + "initialGzipBytes": 46805, + "initialBrotliBytes": 41742, + "rawBytes": 144879, + "gzipBytes": 49997, + "brotliBytes": 44635, + "sources": [ + { + "file": "assets/index-BWTHmDz7.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19391 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16345 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16146 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12216 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4050 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3010 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2733 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/__root.tsx", + "estimatedBytes": 1407 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 701 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 688 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 564 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 378 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 316 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 263 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 179 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 75 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 67 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 28 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-C_W09Kf9.js", + "sources": [ + { + "source": "../../../../../../packages/solid-start-client/dist/esm/GenericHydrate.js", + "estimatedBytes": 2412 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/interaction.js", + "estimatedBytes": 2146 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/runtime.js", + "estimatedBytes": 1448 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/visible.js", + "estimatedBytes": 703 + }, + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 123 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydration/visible.js", + "estimatedBytes": 110 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/Hydrate.js", + "estimatedBytes": 98 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/constants.js", + "estimatedBytes": 91 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/hydration/renderer.js", + "estimatedBytes": 47 + } + ] + }, + { + "file": "assets/routes-Cn5ISO0Z.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-deferred-hydration/src/routes/index.tsx", + "estimatedBytes": 17 + } + ] + } + ] + }, + { + "id": "solid-start.full", + "scenarioDir": "solid-start-full", + "outDir": "solid-start-full", + "toolchain": "vite", + "framework": "solid", + "packageName": "@tanstack/solid-start", + "case": "full", + "entryKey": "../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/solid-start-full/client", + "initialJsFiles": ["assets/index-Dhe0ND7C.js"], + "jsFiles": ["assets/index-Dhe0ND7C.js", "assets/routes-DaGgjiih.js"], + "files": [ + { + "file": "assets/index-Dhe0ND7C.js", + "rawBytes": 152927, + "gzipBytes": 52003, + "brotliBytes": 46190, + "initial": true + }, + { + "file": "assets/routes-DaGgjiih.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 94, + "initial": false + } + ], + "initialRawBytes": 152927, + "initialGzipBytes": 52003, + "initialBrotliBytes": 46190, + "rawBytes": 153045, + "gzipBytes": 52131, + "brotliBytes": 46284, + "sources": [ + { + "file": "assets/index-Dhe0ND7C.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19427 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16428 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/dist/solid.js", + "estimatedBytes": 16137 + }, + { + "source": "../../../../../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/web/dist/web.js", + "estimatedBytes": 12214 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8300 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/link.jsx", + "estimatedBytes": 4098 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/__root.tsx", + "estimatedBytes": 3440 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 3168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Match.jsx", + "estimatedBytes": 2731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solidjs+meta@0.29.4_solid-js@1.9.12/node_modules/@solidjs/meta/dist/index.jsx", + "estimatedBytes": 1976 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useBlocker.jsx", + "estimatedBytes": 1846 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/headContentUtils.jsx", + "estimatedBytes": 1756 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1646 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Asset.jsx", + "estimatedBytes": 1572 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Matches.jsx", + "estimatedBytes": 1430 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1211 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/route.jsx", + "estimatedBytes": 938 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/awaited.jsx", + "estimatedBytes": 885 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Transitioner.jsx", + "estimatedBytes": 804 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/CatchBoundary.jsx", + "estimatedBytes": 699 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 618 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/lazyRouteComponent.jsx", + "estimatedBytes": 516 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 433 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/not-found.jsx", + "estimatedBytes": 416 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/utils.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/RouterProvider.jsx", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useMatch.jsx", + "estimatedBytes": 261 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 251 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ClientOnly.jsx", + "estimatedBytes": 228 + }, + { + "source": "../../../../../../packages/solid-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouterState.jsx", + "estimatedBytes": 201 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/Scripts.jsx", + "estimatedBytes": 197 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/renderRouteNotFound.jsx", + "estimatedBytes": 171 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useParams.jsx", + "estimatedBytes": 169 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLocation.jsx", + "estimatedBytes": 163 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerStores.js", + "estimatedBytes": 155 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 143 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useNavigate.jsx", + "estimatedBytes": 142 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useSearch.jsx", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/HeadContent.jsx", + "estimatedBytes": 133 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderData.jsx", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScrollRestoration.jsx", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useLoaderDeps.jsx", + "estimatedBytes": 88 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useCanGoBack.js", + "estimatedBytes": 84 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/solid-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/SafeFragment.jsx", + "estimatedBytes": 66 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/solid-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/StartClient.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+utils@6.3.0_solid-js@1.9.12/node_modules/@solid-primitives/utils/dist/index.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/solid-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 57 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/ScriptOnce.jsx", + "estimatedBytes": 42 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../node_modules/.pnpm/@solid-primitives+refs@1.1.0_solid-js@1.9.12/node_modules/@solid-primitives/refs/dist/index.js", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/matchContext.jsx", + "estimatedBytes": 31 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/useRouter.jsx", + "estimatedBytes": 27 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/solid-router/dist/source/routerContext.jsx", + "estimatedBytes": 16 + } + ] + }, + { + "file": "assets/routes-DaGgjiih.js", + "sources": [ + { + "source": "../../../../scenarios/solid-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 48 + } + ] + } + ] + }, + { + "id": "vue-start.minimal", + "scenarioDir": "vue-start-minimal", + "outDir": "vue-start-minimal", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "minimal", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-minimal/client", + "initialJsFiles": ["assets/index-Cr54SeNl.js"], + "jsFiles": ["assets/index-Cr54SeNl.js", "assets/routes-cOMmwDsi.js"], + "files": [ + { + "file": "assets/index-Cr54SeNl.js", + "rawBytes": 188874, + "gzipBytes": 66326, + "brotliBytes": 59259, + "initial": true + }, + { + "file": "assets/routes-cOMmwDsi.js", + "rawBytes": 118, + "gzipBytes": 126, + "brotliBytes": 108, + "initial": false + } + ], + "initialRawBytes": 188874, + "initialGzipBytes": 66326, + "initialBrotliBytes": 59259, + "rawBytes": 188992, + "gzipBytes": 66452, + "brotliBytes": 59367, + "sources": [ + { + "file": "assets/index-Cr54SeNl.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21862 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16354 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15562 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6190 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2416 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2148 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/__root.tsx", + "estimatedBytes": 1348 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1333 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1138 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 714 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 644 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 536 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 341 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 313 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 303 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 211 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 64 + }, + { + "source": "../../../../scenarios/vue-start-minimal/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-cOMmwDsi.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-minimal/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + }, + { + "id": "vue-start.full", + "scenarioDir": "vue-start-full", + "outDir": "vue-start-full", + "toolchain": "vite", + "framework": "vue", + "packageName": "@tanstack/vue-start", + "case": "full", + "entryKey": "../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "manifestPath": "client/.vite/manifest.json", + "manifestOutDir": "benchmarks/bundle-size/dist/vue-start-full/client", + "initialJsFiles": ["assets/index-CTQXtRLp.js"], + "jsFiles": ["assets/index-CTQXtRLp.js", "assets/routes-BTMh9l3E.js"], + "files": [ + { + "file": "assets/index-CTQXtRLp.js", + "rawBytes": 201482, + "gzipBytes": 70275, + "brotliBytes": 62629, + "initial": true + }, + { + "file": "assets/routes-BTMh9l3E.js", + "rawBytes": 118, + "gzipBytes": 128, + "brotliBytes": 109, + "initial": false + } + ], + "initialRawBytes": 201482, + "initialGzipBytes": 70275, + "initialBrotliBytes": 62629, + "rawBytes": 201600, + "gzipBytes": 70403, + "brotliBytes": 62738, + "sources": [ + { + "file": "assets/index-CTQXtRLp.js", + "sources": [ + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-core@3.5.25/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js", + "estimatedBytes": 45536 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval@1.6.2/node_modules/seroval/dist/index.js", + "estimatedBytes": 21875 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/load-client.js", + "estimatedBytes": 19450 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/router.js", + "estimatedBytes": 16436 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+reactivity@3.5.25/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js", + "estimatedBytes": 15561 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/new-process-route-tree.js", + "estimatedBytes": 8301 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/link.js", + "estimatedBytes": 6353 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+runtime-dom@3.5.25/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js", + "estimatedBytes": 5451 + }, + { + "source": "../../../../../../packages/history/dist/esm/index.js", + "estimatedBytes": 4550 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/__root.tsx", + "estimatedBytes": 3181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useBlocker.js", + "estimatedBytes": 3164 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createServerFn.js", + "estimatedBytes": 3119 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/utils.js", + "estimatedBytes": 2927 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/scroll-restoration.js", + "estimatedBytes": 2585 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/serverFnFetcher.js", + "estimatedBytes": 2583 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/frame-decoder.js", + "estimatedBytes": 2186 + }, + { + "source": "../../../../../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js", + "estimatedBytes": 2175 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Asset.js", + "estimatedBytes": 2152 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Match.js", + "estimatedBytes": 2099 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/alien.js", + "estimatedBytes": 1886 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+store@0.11.1/node_modules/@tanstack/store/dist/atom.js", + "estimatedBytes": 1847 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Matches.js", + "estimatedBytes": 1731 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/path.js", + "estimatedBytes": 1648 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/CatchBoundary.js", + "estimatedBytes": 1332 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/HeadContent.js", + "estimatedBytes": 1250 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/route.js", + "estimatedBytes": 1212 + }, + { + "source": "../../../../../../node_modules/.pnpm/seroval-plugins@1.6.2_seroval@1.6.2/node_modules/seroval-plugins/dist/web-43VA2W_p.js", + "estimatedBytes": 1177 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/headContentUtils.js", + "estimatedBytes": 1164 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/lazyRouteComponent.js", + "estimatedBytes": 1136 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/hydrateStart.js", + "estimatedBytes": 934 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/route.js", + "estimatedBytes": 906 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/rawStreamCodec.js", + "estimatedBytes": 676 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/stores.js", + "estimatedBytes": 657 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Scripts.js", + "estimatedBytes": 643 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/rewrite.js", + "estimatedBytes": 635 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/manifest.js", + "estimatedBytes": 583 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Transitioner.js", + "estimatedBytes": 557 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/not-found.js", + "estimatedBytes": 543 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Html.js", + "estimatedBytes": 535 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/searchParams.js", + "estimatedBytes": 528 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/RouterProvider.js", + "estimatedBytes": 508 + }, + { + "source": "../../../../../../node_modules/.pnpm/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs", + "estimatedBytes": 470 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/qss.js", + "estimatedBytes": 390 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/safeObjectMerge.js", + "estimatedBytes": 380 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/redirect.js", + "estimatedBytes": 373 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/sieve-cache.js", + "estimatedBytes": 365 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/bodyScripts.js", + "estimatedBytes": 356 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js", + "estimatedBytes": 345 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/makeSerovalPlugin.js", + "estimatedBytes": 314 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useMatch.js", + "estimatedBytes": 312 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/awaited.js", + "estimatedBytes": 309 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/utils.js", + "estimatedBytes": 302 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/createMiddleware.js", + "estimatedBytes": 297 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/headers.js", + "estimatedBytes": 292 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/hydrateStart.js", + "estimatedBytes": 290 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamJSONPlugin.js", + "estimatedBytes": 265 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/defer.js", + "estimatedBytes": 258 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScriptOnce.js", + "estimatedBytes": 226 + }, + { + "source": "../../../../../../packages/vue-start/dist/esm/useServerFn.js", + "estimatedBytes": 221 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/Body.js", + "estimatedBytes": 220 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ClientOnly.js", + "estimatedBytes": 210 + }, + { + "source": "../../../../../../node_modules/.pnpm/@tanstack+vue-store@0.11.1_vue@3.5.25_@typescript+typescript6@6.0.2_/node_modules/@tanstack/vue-store/dist/useSelector.js", + "estimatedBytes": 190 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client/ServerFunctionSerializationAdapter.js", + "estimatedBytes": 181 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/renderRouteNotFound.js", + "estimatedBytes": 168 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/client-rpc/createClientRpc.js", + "estimatedBytes": 158 + }, + { + "source": "../../../../../../packages/vue-start-client/dist/esm/StartClient.js", + "estimatedBytes": 156 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouterState.js", + "estimatedBytes": 150 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStreamRPCPlugin.js", + "estimatedBytes": 140 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/constants.js", + "estimatedBytes": 139 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useNavigate.js", + "estimatedBytes": 135 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useParams.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useSearch.js", + "estimatedBytes": 129 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/ssr-match-id.js", + "estimatedBytes": 120 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderData.js", + "estimatedBytes": 111 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getDefaultSerovalPlugins.js", + "estimatedBytes": 106 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLoaderDeps.js", + "estimatedBytes": 95 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/ScrollRestoration.js", + "estimatedBytes": 94 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartContextServerOnly.js", + "estimatedBytes": 93 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routeTree.gen.ts", + "estimatedBytes": 93 + }, + { + "source": "../../../../../../packages/vue-start/dist/plugin/default-entry/client.tsx", + "estimatedBytes": 89 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouteContext.js", + "estimatedBytes": 82 + }, + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx", + "estimatedBytes": 81 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/RawStream.js", + "estimatedBytes": 74 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useLocation.js", + "estimatedBytes": 72 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useCanGoBack.js", + "estimatedBytes": 71 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerStores.js", + "estimatedBytes": 68 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/router.js", + "estimatedBytes": 65 + }, + { + "source": "../../../../scenarios/vue-start-full/src/router.tsx", + "estimatedBytes": 61 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/fileRoute.js", + "estimatedBytes": 60 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/routerContext.js", + "estimatedBytes": 52 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/seroval-plugins.js", + "estimatedBytes": 50 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/invariant.js", + "estimatedBytes": 46 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/not-found.js", + "estimatedBytes": 41 + }, + { + "source": "../../../../../../packages/start-client-core/dist/esm/getStartOptions.js", + "estimatedBytes": 40 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/link.js", + "estimatedBytes": 36 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/matchContext.js", + "estimatedBytes": 35 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/useRouter.js", + "estimatedBytes": 33 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/ssr/serializer/transformer.js", + "estimatedBytes": 24 + }, + { + "source": "../../../../../../packages/router-core/dist/esm/root.js", + "estimatedBytes": 18 + }, + { + "source": "../../../../../../packages/vue-router/dist/esm/scroll-restoration.js", + "estimatedBytes": 4 + } + ] + }, + { + "file": "assets/routes-BTMh9l3E.js", + "sources": [ + { + "source": "../../../../scenarios/vue-start-full/src/routes/index.tsx?tsr-split=component", + "estimatedBytes": 76 + } + ] + } + ] + } + ], + "generatedAt": "2026-09-26T14:44:59.413Z", + "sha": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd" +} diff --git a/benchmarks/compiler/results/workflow-after.json b/benchmarks/compiler/results/workflow-after.json new file mode 100644 index 00000000000..6df1c26eefa --- /dev/null +++ b/benchmarks/compiler/results/workflow-after.json @@ -0,0 +1,107 @@ +{ + "timestamp": "2026-09-26T14:48:12.644Z", + "compilerFingerprint": { + "commit": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/137d/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 3, + "diagnosticOnly": false, + "warmups": 1, + "summary": { + "yuku-splitter": { + "medianMsPerCorpus": 109.47915266666666, + "minMsPerCorpus": 109.47915266666666, + "maxMsPerCorpus": 109.47915266666666, + "medianPeakRssMiB": 142.734375, + "medianRetainedHeapMiB": 7.991462707519531, + "medianWallMs": 544.022916, + "phasesMsPerCorpus": { + "parseAnalyze": 13.80327466666688, + "detectGroupings": 0.1154189999999365, + "sharedAnalysis": 2.1330990000001293, + "referenceCompile": 30.270637333332843, + "virtualCompile": 58.2318856666667, + "sharedCompile": 3.467555333333299 + }, + "countsPerCorpus": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 544.022916, + "mode": "yuku-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 328.437458, + "phases": { + "parseAnalyze": 41.40982400000064, + "detectGroupings": 0.3462569999998095, + "sharedAnalysis": 6.399297000000388, + "referenceCompile": 90.81191199999853, + "virtualCompile": 174.6956570000001, + "sharedCompile": 10.402665999999897 + }, + "counts": { + "parses": 156, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 146160, + "before": { + "rss": 98304000, + "heapTotal": 31293440, + "heapUsed": 8290960, + "external": 3732273, + "arrayBuffers": 509287 + }, + "after": { + "rss": 149504000, + "heapTotal": 52264960, + "heapUsed": 22583744, + "external": 5129090, + "arrayBuffers": 2838350 + }, + "retained": { + "rss": 149012480, + "heapTotal": 44138496, + "heapUsed": 8379656, + "external": 5129090, + "arrayBuffers": 380951 + }, + "outputBytes": 535904, + "outputMapBytes": 1993316, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/workflow-before.json b/benchmarks/compiler/results/workflow-before.json new file mode 100644 index 00000000000..24576ba9d52 --- /dev/null +++ b/benchmarks/compiler/results/workflow-before.json @@ -0,0 +1,103 @@ +{ + "timestamp": "2026-09-26T14:44:24.879Z", + "compilerFingerprint": { + "commit": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + }, + "workspace": "/Users/Flo/.codex/worktrees/yuku-baseline/router", + "fixturesRoot": "/var/folders/yp/rq726d2d0d7g6xxqbg_dd8km0000gn/T/yuku-original-corpus-bglioxxf", + "node": "v24.8.0", + "platform": "darwin", + "arch": "arm64", + "cpu": "Apple M3 Max", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "repetitions": 1, + "iterations": 3, + "diagnosticOnly": false, + "warmups": 1, + "summary": { + "babel-splitter": { + "medianMsPerCorpus": 358.3896526666667, + "minMsPerCorpus": 358.3896526666667, + "maxMsPerCorpus": 358.3896526666667, + "medianPeakRssMiB": 384.140625, + "medianRetainedHeapMiB": 21.72418212890625, + "medianWallMs": 1737.159, + "phasesMsPerCorpus": { + "detectGroupings": 41.61356966666616, + "sharedAnalysis": 29.516456999999644, + "referenceCompile": 116.36712433333332, + "virtualCompile": 162.05888933333327, + "sharedCompile": 7.046526999999894 + }, + "countsPerCorpus": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + } + } + }, + "samples": [ + { + "repetition": 0, + "wallMs": 1737.159, + "mode": "babel-splitter", + "corpus": { + "files": 52, + "bytes": 43238, + "sha256": "db1fbf4179e31c63b623a3eb3e5ea3a148ff27b3300ea8dbed97afb396857a1e" + }, + "elapsedMs": 1075.168958, + "phases": { + "detectGroupings": 124.84070899999847, + "sharedAnalysis": 88.54937099999893, + "referenceCompile": 349.10137299999997, + "virtualCompile": 486.17666799999984, + "sharedCompile": 21.13958099999968 + }, + "counts": { + "parses": 858, + "outputs": 517, + "sharedModules": 26, + "unchangedReferences": 29 + }, + "peakRssKiB": 393360, + "before": { + "rss": 300335104, + "heapTotal": 160022528, + "heapUsed": 21053520, + "external": 2766078, + "arrayBuffers": 24947 + }, + "after": { + "rss": 402538496, + "heapTotal": 204603392, + "heapUsed": 89645016, + "external": 2547294, + "arrayBuffers": 237939 + }, + "retained": { + "rss": 401293312, + "heapTotal": 192282624, + "heapUsed": 22779456, + "external": 2547294, + "arrayBuffers": 24947 + }, + "outputBytes": 560392, + "outputMapBytes": 2320568, + "resolvedReferences": 0 + } + ] +} diff --git a/benchmarks/compiler/results/workflow-contracts.json b/benchmarks/compiler/results/workflow-contracts.json new file mode 100644 index 00000000000..452ce97724a --- /dev/null +++ b/benchmarks/compiler/results/workflow-contracts.json @@ -0,0 +1,64 @@ +{ + "testFile": "packages/router-plugin/tests/hmr-exports.test.ts", + "supportingCommits": [ + "0ec43cd02c88574bc2d12a42a1f54ddcb00af3b7", + "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd" + ], + "baselineCompilerCommit": "bb4423e09872aee4f2544600d0eba3303fc7db56", + "before": { + "passed": 8, + "failed": 8, + "total": 16, + "log": "/tmp/yuku-before-contract-tests.log", + "failedWithAutoCodeSplitting": true, + "exportCases": [ + "function", + "overloaded function", + "shared function", + "variable", + "multiple variables", + "default", + "class", + "explicit alias" + ], + "compilerFingerprint": { + "commit": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "sha256": "413ee3fb6fefb17f03a5050229c0a967298c197a07d2bdf33d8cf12ad5754519", + "javascriptFiles": 125, + "sourceSha256": "7da7629b973a535ed58b890f548a9eb317446ef0fc72d78c9cdc5350c420c595", + "sourceFiles": 137, + "dependencyVersions": { + "@babel/generator": "7.29.8", + "@babel/types": "7.29.8" + } + } + }, + "after": { + "passed": 16, + "failed": 0, + "total": 16, + "log": "/tmp/yuku-after-contract-tests.log", + "compilerFingerprint": { + "commit": "f69eb7a5aa5a4cedc95c1d995339f7a3e9bf00fd", + "sha256": "9c8751495155f052d418d5aabd437317091a3dfef76e8d6dbc9cf90a42803fc5", + "javascriptFiles": 125, + "sourceSha256": "b194df1fe4ed7069df76ac9a4301a3b3de5b47b25ae180ac3173e76f606a6852", + "sourceFiles": 137, + "dependencyVersions": { + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0", + "@yuku-toolchain/types": "0.11.0" + } + } + }, + "interpretation": "The same intended public export contracts reveal preexisting Babel split-route deficiencies; these baseline failures are not Yuku regressions. All contracts pass after the native implementation is restored.", + "performanceSmoke": { + "freshProcesses": 1, + "warmups": 1, + "measuredPasses": 3, + "before": "workflow-before.json", + "after": "workflow-after.json", + "interpretation": "Workflow smoke only. Primary speed conclusions use the five alternating baseline/candidate pairs in final-alternating.json." + } +} diff --git a/benchmarks/compiler/yuku-feasibility/README.md b/benchmarks/compiler/yuku-feasibility/README.md index 14cfa80d69c..621f5e50df1 100644 --- a/benchmarks/compiler/yuku-feasibility/README.md +++ b/benchmarks/compiler/yuku-feasibility/README.md @@ -1,5 +1,11 @@ # Yuku feasibility and upstream findings +Reported upstream: + +- [Missing JSX component references (migration blocker)](https://github.com/yuku-toolchain/yuku/issues/204) +- [Whitespace-padded purity comments are dropped](https://github.com/yuku-toolchain/yuku/issues/202) +- [Invalid object-method AST crashes code generation](https://github.com/yuku-toolchain/yuku/issues/203) + Investigated with Node 24.8.0 on macOS arm64, using published `yuku-parser`, `yuku-analyzer`, and `yuku-codegen` **0.11.0**. The independent syntax oracle was `@babel/parser` 7.28.5; it is only an investigation tool, not a proposed runtime @@ -7,6 +13,64 @@ compatibility layer. The initial isolated probes did not change workspace depend migration uses Yuku directly in the compiler packages; Babel is not retained as an AST compatibility layer. +## Migration blocker: non-ASCII-uppercase JSX component references are missing + +Published `yuku-analyzer` 0.11.0 records no binding references for standalone +`<_Widget />`, `<$Widget />`, `<ÉWidget />`, or `<éWidget />` tags. These tags +refer to JavaScript values. Plain ASCII-uppercase `` and member tags +such as `<_Widget.Child />` work. Lowercase intrinsic tags such as `` +and namespaced tags such as `` correctly produce no value references. +Opening and closing component tags are both affected. + +Run the standalone dependency-only reproducer against an installation containing +`yuku-analyzer`: + +```sh +node benchmarks/compiler/yuku-feasibility/jsx-reference-repro.mjs packages/router-utils +``` + +The assertion fails with eight missing-reference cases and one false reference +for the intrinsic `` tag on 0.11.0. This script +uses only the published `analyze` API and does not modify semantic tables or ASTs. +The separate public Vite Router reproducer, +[`jsx-prefixed-route-repro.mjs`](./jsx-prefixed-route-repro.mjs), demonstrates a +runtime consequence: a component used by an eager route option and a split JSX +component can be omitted from the lazy chunk, causing a `ReferenceError`. +The ASCII-uppercase control passes. This is a migration correctness blocker, +not only a bundle-size issue. + +Run the public Router check in the native checkout (expected to fail), or verify +the exact known failure without leaving the diagnostic process unsuccessful: + +```sh +node benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs --workspace "$PWD" +node benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs --workspace "$PWD" --expect-regression +``` + +Passing `--workspace /path/to/baseline/router` runs the same public plugin and +runtime contract against the built baseline. The Babel baseline passed all three +component names (`Widget`, `_Widget`, `$Widget`); the native version throws for +the latter two. This checks rendering and loader execution, not cross-chunk +identity: the baseline has a separate, preexisting duplication limitation. + +Root cause is the ASCII-uppercase-only condition in upstream +[`src/parser/semantic/binder.zig:1038`](https://github.com/yuku-toolchain/yuku/blob/eb400037678815bdbc2e5477c4b5458e436286ad/src/parser/semantic/binder.zig#L1038). +The inspected source is commit `eb400037678815bdbc2e5477c4b5458e436286ad`. +[`jsx-reference-upstream.patch`](./jsx-reference-upstream.patch) proposes recording +every non-intrinsic standalone tag, retaining the existing member-root behavior. +It includes upstream tests for underscore, dollar, and Unicode names; opening +and closing tags; lexical shadowing; intrinsic tags; and namespaced tags. The +patch is a proposal, has not been applied to the dependency, and has not been +compiled or run in the upstream repository. + +The full bundle comparison also exposed this defect through generated `<_H0 />` +Hydrate tags: the missing reference makes route cleanup preserve the lazy factory +as an initially unused declaration. Each deferred-hydration eager entry retains +65 raw bytes of unnecessary output (React +33 gzip/+22 Brotli; Solid +32 gzip/+61 +Brotli across all client assets). These are removable residues once upstream +reference tracking is corrected, not required runtime behavior. No production +workaround, generated-name change, or purity annotation was added locally. + ## Confirmed upstream defect: whitespace-padded purity comments disappear The documented default `comments: 'some'` policy promises preservation of diff --git a/benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs b/benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs new file mode 100644 index 00000000000..38c1c64cdce --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/jsx-prefixed-route-repro.mjs @@ -0,0 +1,99 @@ +import assert from 'node:assert/strict' +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +// Public Vite/router-plugin reproduction. No internal AST or cache mutation. +// Default asserts correct behavior; --expect-regression asserts the known bug. +const args = process.argv.slice(2) +const workspaceIndex = args.indexOf('--workspace') +const workspace = path.resolve( + workspaceIndex === -1 + ? fileURLToPath(new URL('../../../', import.meta.url)) + : args[workspaceIndex + 1], +) +const expectRegression = args.includes('--expect-regression') +const { createServer } = await import( + pathToFileURL(path.join(workspace, 'node_modules/vite/dist/node/index.js')) +) +const { tanstackRouter } = await import( + pathToFileURL(path.join(workspace, 'packages/router-plugin/dist/esm/vite.js')) +) +const directory = await mkdtemp( + path.join(workspace, 'packages/router-plugin/.jsx-reference-repro-'), +) +let server +const cases = [ + ['control', 'Widget'], + ['underscore', '_Widget'], + ['dollar', '$Widget'], +] +const results = [] +try { + await mkdir(path.join(directory, 'routes')) + await writeFile( + path.join(directory, 'routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router'; +export const Route = createRootRoute({});`, + ) + for (const [filename, name] of cases) { + await writeFile( + path.join(directory, `routes/${filename}.tsx`), + `import React from 'react'; +import { createFileRoute } from '@tanstack/react-router'; +const ${name} = () => 'hello'; +export const Route = createFileRoute('/${filename}')({ + loader: () => ${name}, + component: () => <${name} />, +});`, + ) + } + server = await createServer({ + root: directory, + configFile: false, + logLevel: 'silent', + server: { watch: null }, + plugins: [ + tanstackRouter({ + target: 'react', + routesDirectory: './routes', + generatedRouteTree: './routeTree.gen.ts', + autoCodeSplitting: true, + codeSplittingOptions: { + addHmr: false, + defaultBehavior: [['loader'], ['component']], + }, + }), + ], + }) + for (const [filename, name] of cases) { + // The physical module plans shared ownership before split modules load. + await server.ssrLoadModule(`/routes/${filename}.tsx`) + const componentModule = await server.ssrLoadModule( + `/routes/${filename}.tsx?tsr-split=component`, + ) + const loaderModule = await server.ssrLoadModule( + `/routes/${filename}.tsx?tsr-split=loader`, + ) + if (expectRegression && filename !== 'control') { + assert.throws(() => componentModule.component(), { + name: 'ReferenceError', + message: `${name} is not defined`, + }) + results.push({ name, result: 'confirmed missing JSX binding' }) + } else { + const element = componentModule.component() + assert.equal(typeof element.type, 'function') + assert.equal(element.type(), 'hello') + assert.equal(loaderModule.loader()(), 'hello') + results.push({ + name, + result: 'component and loader execute successfully', + }) + } + } + console.log(JSON.stringify({ workspace, expectRegression, results }, null, 2)) +} finally { + await server?.close() + await rm(directory, { recursive: true, force: true }) +} diff --git a/benchmarks/compiler/yuku-feasibility/jsx-reference-repro.mjs b/benchmarks/compiler/yuku-feasibility/jsx-reference-repro.mjs new file mode 100644 index 00000000000..19ae01c5a1a --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/jsx-reference-repro.mjs @@ -0,0 +1,65 @@ +import assert from 'node:assert/strict' +import { createRequire } from 'node:module' +import path from 'node:path' +import { pathToFileURL } from 'node:url' + +const dependencyRoot = process.argv[2] +assert( + dependencyRoot, + 'Usage: node jsx-reference-repro.mjs /path/to/dependency-install', +) +const require = createRequire( + path.join(path.resolve(dependencyRoot), 'package.json'), +) +const { analyze } = await import( + pathToFileURL(require.resolve('yuku-analyzer')) +) +const failures = [] +for (const name of ['Widget', '_Widget', '$Widget', 'ÉWidget', 'éWidget']) { + for (const [tag, expected] of [ + [`<${name} />`, 1], + [`<${name}>`, 2], + [`<${name}.Child />`, 1], + ]) { + const module = analyze( + `const ${name} = () => null; export const render = () => ${tag};`, + { path: 'input.tsx' }, + ) + const symbol = module.rootScope.find(name) + const actual = symbol.references.length + if (actual !== expected) { + failures.push({ tag, expected, actual }) + } + } +} +for (const tag of [ + '', + '', + '', + '', + '', +]) { + const module = analyze(`export const render = () => ${tag};`, { + path: 'input.tsx', + }) + if (module.unresolvedReferences.length !== 0) { + failures.push({ + tag, + expected: 0, + actual: module.unresolvedReferences.length, + }) + } +} +const member = analyze( + 'const widget = {}; export const render = () => ;', + { + path: 'input.tsx', + }, +) +assert.equal(member.rootScope.find('widget').references.length, 1) +console.log(JSON.stringify({ failures }, null, 2)) +assert.deepEqual( + failures, + [], + 'Every non-intrinsic JSX tag must record its binding references', +) diff --git a/benchmarks/compiler/yuku-feasibility/jsx-reference-upstream.patch b/benchmarks/compiler/yuku-feasibility/jsx-reference-upstream.patch new file mode 100644 index 00000000000..a1ac469f645 --- /dev/null +++ b/benchmarks/compiler/yuku-feasibility/jsx-reference-upstream.patch @@ -0,0 +1,61 @@ +--- a/src/parser/semantic/binder.zig ++++ b/src/parser/semantic/binder.zig +@@ -1035,7 +1035,9 @@ + .jsx_member_expression => true, + else => false, + }; +- if (member or (text.len > 0 and text[0] >= 'A' and text[0] <= 'Z')) { ++ const intrinsic = text.len > 0 and ++ ((text[0] >= 'a' and text[0] <= 'z') or std.mem.indexOfScalar(u8, text, '-') != null); ++ if (member or (text.len > 0 and !intrinsic)) { + _ = try self.addReference(id.name, scope.current, root_idx, .{}); + } + } +--- a/test/analyzer/references.test.ts ++++ b/test/analyzer/references.test.ts +@@ -240,6 +240,45 @@ + }); + + describe("JSX", () => { ++ test("non-intrinsic JSX names include underscore, dollar, and Unicode prefixes", () => { ++ for (const name of ["Widget", "_Widget", "$Widget", "ÉWidget", "éWidget"]) { ++ for (const [tag, expected] of [ ++ [`<${name} />`, 1], ++ [`<${name}>`, 2], ++ [`<${name}.Child />`, 1], ++ ] as const) { ++ const module = new Analyzer().addFile( ++ "input.tsx", ++ `const ${name} = () => null; export const render = () => ${tag};`, ++ ); ++ const symbol = module.rootScope.find(name)!; ++ expect(symbol.references.length).toBe(expected); ++ expect(symbol.references.every((reference) => reference.symbol === symbol)).toBe(true); ++ } ++ } ++ }); ++ ++ test("JSX component names resolve to the nearest lexical declaration", () => { ++ const module = new Analyzer().addFile( ++ "input.tsx", ++ `const _Widget = () => null; ++ function render() { const _Widget = () => null; return <_Widget />; }`, ++ ); ++ const outer = module.rootScope.find("_Widget")!; ++ const inner = module.symbols.find((symbol) => symbol.name === "_Widget" && symbol !== outer)!; ++ expect(outer.references.length).toBe(0); ++ expect(inner.references.length).toBe(1); ++ expect(inner.references[0].symbol).toBe(inner); ++ }); ++ ++ test("intrinsic and namespaced tags do not create variable references", () => { ++ const module = new Analyzer().addFile( ++ "input.tsx", ++ `export const render = () => <>
;`, ++ ); ++ expect(module.unresolvedReferences.length).toBe(0); ++ }); ++ + test("a component name resolves to its binding, an intrinsic element is free", () => { + expect( + summary(`const App = () =>
; function Foo() { return null; }`, { diff --git a/packages/react-start-rsc/src/plugin/rscCssTransform.ts b/packages/react-start-rsc/src/plugin/rscCssTransform.ts index 15b882ccd77..71744183219 100644 --- a/packages/react-start-rsc/src/plugin/rscCssTransform.ts +++ b/packages/react-start-rsc/src/plugin/rscCssTransform.ts @@ -1,3 +1,4 @@ +import { cloneGeneratedNode } from '@tanstack/router-utils' import type { StartCompilerImportTransform, StartCompilerTransformContext, @@ -6,8 +7,7 @@ import type { const TSS_SERVERFN_SPLIT_PARAM = 'tss-serverfn-split' const RSC_CSS_OPTIONS_KEY = '__tanstackStartRscCss' -type BabelTypes = StartCompilerTransformContext['types'] -type BabelExpression = ReturnType< +type NativeExpression = ReturnType< StartCompilerTransformContext['parseExpression'] > @@ -20,7 +20,7 @@ export function createRscCssCompilerTransforms(opts: { loadCssExpression: string serverFnProviderOnly?: boolean | undefined }): Array { - let loadCssExpression: BabelExpression | undefined + let loadCssExpression: NativeExpression | undefined const getLoadCssExpression = (context: StartCompilerTransformContext) => { loadCssExpression ??= context.parseExpression(opts.loadCssExpression) @@ -54,7 +54,7 @@ function createRscCssCompilerTransform(opts: { kind: RscCssTransformKind getLoadCssExpression: ( context: StartCompilerTransformContext, - ) => BabelExpression + ) => NativeExpression serverFnProviderOnly?: boolean | undefined }): StartCompilerImportTransform { return { @@ -79,56 +79,60 @@ function createRscCssCompilerTransform(opts: { return } - const t = context.types const loadCssExpression = opts.getLoadCssExpression(context) - const cloneLoadCssExpression = () => t.cloneNode(loadCssExpression) + const cloneLoadCssExpression = () => cloneGeneratedNode(loadCssExpression) for (const candidate of candidates) { - const args = candidate.path.node.arguments - if (args.length !== 1) continue + const args = candidate.node.arguments + if (args.length !== 1) { + continue + } if (opts.kind === 'renderToReadableStream') { const firstArg = args[0] - if (!firstArg || !t.isExpression(firstArg)) continue - if (!isTopLevelJsx(t, firstArg)) continue + if (!firstArg || firstArg.type === 'SpreadElement') { + continue + } + if (!isTopLevelJsx(firstArg)) { + continue + } args[0] = createCssFragment( - t, + context, firstArg, cloneLoadCssExpression(), ) as typeof firstArg continue } - args.push( - t.objectExpression([ - t.objectProperty( - t.identifier(RSC_CSS_OPTIONS_KEY), - cloneLoadCssExpression(), - ), - ]), + const options = context.parseExpression( + `{ ${RSC_CSS_OPTIONS_KEY}: null }`, ) + if ( + options.type === 'ObjectExpression' && + options.properties[0]?.type === 'Property' + ) { + options.properties[0].value = cloneLoadCssExpression() + args.push(options) + } } }, } } -function isTopLevelJsx(t: BabelTypes, expr: BabelExpression): boolean { - const unwrapped = unwrapTransparentExpression(t, expr) - return t.isJSXElement(unwrapped) || t.isJSXFragment(unwrapped) +function isTopLevelJsx(expr: NativeExpression): boolean { + const unwrapped = unwrapTransparentExpression(expr) + return unwrapped.type === 'JSXElement' || unwrapped.type === 'JSXFragment' } -function unwrapTransparentExpression( - t: BabelTypes, - expr: BabelExpression, -): BabelExpression { +function unwrapTransparentExpression(expr: NativeExpression): NativeExpression { let current = expr while ( - t.isParenthesizedExpression(current) || - t.isTSAsExpression(current) || - t.isTSSatisfiesExpression(current) || - t.isTSTypeAssertion(current) || - t.isTSNonNullExpression(current) + current.type === 'ParenthesizedExpression' || + current.type === 'TSAsExpression' || + current.type === 'TSSatisfiesExpression' || + current.type === 'TSTypeAssertion' || + current.type === 'TSNonNullExpression' ) { current = current.expression } @@ -136,15 +140,24 @@ function unwrapTransparentExpression( } function createCssFragment( - t: BabelTypes, - original: BabelExpression, - loadCssExpression: BabelExpression, + context: StartCompilerTransformContext, + original: NativeExpression, + loadCssExpression: NativeExpression, ) { - const unwrapped = unwrapTransparentExpression(t, original) - return t.jsxFragment(t.jsxOpeningFragment(), t.jsxClosingFragment(), [ - t.jsxExpressionContainer(loadCssExpression), - t.isJSXElement(unwrapped) || t.isJSXFragment(unwrapped) - ? unwrapped - : t.jsxExpressionContainer(original), - ]) + const fragment = context.parseExpression('<>{null}{null}') + if ( + fragment.type !== 'JSXFragment' || + fragment.children[0]?.type !== 'JSXExpressionContainer' || + fragment.children[1]?.type !== 'JSXExpressionContainer' + ) { + throw new Error('Expected compiler fragment') + } + fragment.children[0].expression = loadCssExpression + const unwrapped = unwrapTransparentExpression(original) + if (unwrapped.type === 'JSXElement' || unwrapped.type === 'JSXFragment') { + fragment.children[1] = unwrapped + } else { + fragment.children[1].expression = original + } + return fragment } diff --git a/packages/react-start-rsc/tests/rscCssTransform.test.tsx b/packages/react-start-rsc/tests/rscCssTransform.test.tsx index 0e2c2e45cf9..3f6e8b7c2ed 100644 --- a/packages/react-start-rsc/tests/rscCssTransform.test.tsx +++ b/packages/react-start-rsc/tests/rscCssTransform.test.tsx @@ -70,14 +70,8 @@ describe('RSC CSS compiler transforms', () => { expect(code).toMatchInlineSnapshot(` "import { createCompositeComponent, renderServerComponent, renderToReadableStream } from '@tanstack/react-start/rsc'; - export const renderable = renderServerComponent(, { - __tanstackStartRscCss: import.meta.viteRsc.loadCss() - }); - export const composite = createCompositeComponent(() => ({ - Card: - }), { - __tanstackStartRscCss: import.meta.viteRsc.loadCss() - }); + export const renderable = renderServerComponent(, { __tanstackStartRscCss: import.meta.viteRsc.loadCss() }); + export const composite = createCompositeComponent(() => ({ Card: }), { __tanstackStartRscCss: import.meta.viteRsc.loadCss() }); export const stream = renderToReadableStream(<>{import.meta.viteRsc.loadCss()});" `) }) @@ -101,9 +95,7 @@ describe('RSC CSS compiler transforms', () => { expect(code).toMatchInlineSnapshot(` "import { renderServerComponent, renderToReadableStream } from '@tanstack/react-start/rsc'; const node = ; - export const existingOptions = renderServerComponent(, { - alreadyConfigured: true - }); + export const existingOptions = renderServerComponent(, { alreadyConfigured: true }); export const nonJsxStream = renderToReadableStream(node);" `) }) @@ -133,9 +125,7 @@ describe('RSC CSS compiler transforms', () => { "callerCode": "import { renderServerComponent } from '@tanstack/react-start/rsc'; export const renderable = renderServerComponent();", "providerCode": "import { renderServerComponent } from '@tanstack/react-start/rsc'; - export const renderable = renderServerComponent(, { - __tanstackStartRscCss: import.meta.rspackRsc.loadCss() - });", + export const renderable = renderServerComponent(, { __tanstackStartRscCss: import.meta.rspackRsc.loadCss() });", } `) }) diff --git a/packages/router-generator/package.json b/packages/router-generator/package.json index b27ea01b5be..4f7fa03e60b 100644 --- a/packages/router-generator/package.json +++ b/packages/router-generator/package.json @@ -65,14 +65,15 @@ "node": ">=20.19" }, "dependencies": { - "@babel/types": "catalog:", "@tanstack/router-core": "workspace:*", "@tanstack/router-utils": "workspace:*", "@tanstack/virtual-file-routes": "workspace:*", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.9.6", - "zod": "catalog:" + "zod": "catalog:", + "@yuku-toolchain/types": "0.11.0", + "yuku-ast": "0.11.0" }, "devDependencies": { "@tanstack/react-router": "workspace:*", diff --git a/packages/router-generator/src/transform/transform.ts b/packages/router-generator/src/transform/transform.ts index 9fcad87948c..b56d9a7fbab 100644 --- a/packages/router-generator/src/transform/transform.ts +++ b/packages/router-generator/src/transform/transform.ts @@ -1,6 +1,7 @@ import MagicString from 'magic-string' -import * as t from '@babel/types' -import { parseAst } from '@tanstack/router-utils' +import { is } from 'yuku-ast' +import { analyzeModule, unwrapExpression } from '@tanstack/router-utils' +import type * as t from '@yuku-toolchain/types' import type { TransformOptions, TransformResult } from './types' const routeConstructors = ['createFileRoute', 'createLazyFileRoute'] as const @@ -51,10 +52,10 @@ export function transform({ filename, node, }: TransformOptions): TransformResult { - let ast: ReturnType + let ast: ReturnType try { - ast = parseAst({ code: source, filename }) + ast = analyzeModule({ code: source, filename }) } catch (error) { return { result: 'error', @@ -62,7 +63,7 @@ export function transform({ } } - const exportedRouteNames = getExportedRouteNames(ast.program.body) + const exportedRouteNames = getExportedRouteNames(ast.ast.body) if (exportedRouteNames.size === 0) { return { result: 'no-route-export' } @@ -72,7 +73,7 @@ export function transform({ calls: routeCalls, hasUnsupportedRouteId, hasMalformedRouteCall, - } = findExportedRouteCalls(ast.program.body, exportedRouteNames) + } = findExportedRouteCalls(ast.ast.body, exportedRouteNames) if (routeCalls.length === 0 && hasMalformedRouteCall) { return { @@ -116,24 +117,24 @@ export function transform({ const expectedCallee = getExpectedRouteConstructor(ctx.lazy) const expectedRouteId = `${routeIdQuote}${ctx.routeId}${routeIdQuote}` const currentRouteId = source.slice( - routeCall.routeIdArg.start!, - routeCall.routeIdArg.end!, + routeCall.routeIdArg.start, + routeCall.routeIdArg.end, ) const targetModule = `@tanstack/${ctx.target}-router` - const imports = parseTargetImports(ast.program.body, source, targetModule) + const imports = parseTargetImports(ast.ast.body, source, targetModule) const s = new MagicString(source) let modified = false if (routeCall.callee.name !== expectedCallee) { - s.update(routeCall.callee.start!, routeCall.callee.end!, expectedCallee) + s.update(routeCall.callee.start, routeCall.callee.end, expectedCallee) modified = true } if (currentRouteId !== expectedRouteId) { s.update( - routeCall.routeIdArg.start!, - routeCall.routeIdArg.end!, + routeCall.routeIdArg.start, + routeCall.routeIdArg.end, expectedRouteId, ) modified = true @@ -162,17 +163,17 @@ export function transform({ } } -function getExportedRouteNames(body: Array) { +function getExportedRouteNames(body: t.Program['body']) { const exportedRouteNames = new Set() for (const statement of body) { - if (!t.isExportNamedDeclaration(statement) || statement.source) { + if (!is.ExportNamedDeclaration(statement) || statement.source) { continue } - if (t.isVariableDeclaration(statement.declaration)) { + if (is.VariableDeclaration(statement.declaration)) { for (const declarator of statement.declaration.declarations) { - if (t.isIdentifier(declarator.id) && declarator.id.name === 'Route') { + if (is.Identifier(declarator.id) && declarator.id.name === 'Route') { exportedRouteNames.add('Route') } } @@ -180,7 +181,7 @@ function getExportedRouteNames(body: Array) { for (const specifier of statement.specifiers) { if ( - !t.isExportSpecifier(specifier) || + !is.ExportSpecifier(specifier) || getExportedName(specifier.exported) !== 'Route' ) { continue @@ -197,7 +198,7 @@ function getExportedRouteNames(body: Array) { } function findExportedRouteCalls( - body: Array, + body: t.Program['body'], exportedRouteNames: Set, ): RouteCallAnalysis { const calls: Array = [] @@ -212,7 +213,7 @@ function findExportedRouteCalls( for (const declarator of declaration.declarations) { if ( - !t.isIdentifier(declarator.id) || + !is.Identifier(declarator.id) || !exportedRouteNames.has(declarator.id.name) ) { continue @@ -242,35 +243,41 @@ function findExportedRouteCalls( return { calls, hasUnsupportedRouteId, hasMalformedRouteCall } } -function getVariableDeclaration(statement: t.Statement) { - const declaration = t.isExportNamedDeclaration(statement) +function getVariableDeclaration(statement: t.ProgramStatement) { + const declaration = is.ExportNamedDeclaration(statement) ? statement.declaration : statement - return t.isVariableDeclaration(declaration) ? declaration : null + return is.VariableDeclaration(declaration) ? declaration : null } function getExportedName(node: t.Identifier | t.StringLiteral) { - return t.isIdentifier(node) ? node.name : node.value + return is.Identifier(node) ? node.name : node.value } function getLocalBindingName(node: t.Identifier | t.StringLiteral) { - return t.isIdentifier(node) ? node.name : null + return is.Identifier(node) ? node.name : null } function getRouteConstructorInit(expression: t.Expression | null | undefined) { - if (!expression || !t.isCallExpression(expression)) { + if (!expression) { return null } - - if (!t.isCallExpression(expression.callee)) { + expression = unwrapExpression(expression) + if (!is.CallExpression(expression)) { + return null + } + const callee = is.Expression(expression.callee) + ? unwrapExpression(expression.callee) + : expression.callee + if (!is.CallExpression(callee)) { return null } - const innerCall = expression.callee + const innerCall = callee if ( - !t.isIdentifier(innerCall.callee) || + !is.Identifier(innerCall.callee) || !isRouteConstructor(innerCall.callee) ) { return null @@ -286,10 +293,11 @@ function getRouteConstructorInit(expression: t.Expression | null | undefined) { function isDirectRouteConstructorCall( expression: t.Expression | null | undefined, ) { + expression = expression ? unwrapExpression(expression) : expression return ( !!expression && - t.isCallExpression(expression) && - t.isIdentifier(expression.callee) && + is.CallExpression(expression) && + is.Identifier(expression.callee) && isRouteConstructor(expression.callee) ) } @@ -305,8 +313,8 @@ function isSupportedRouteId( ): arg is SupportedRouteId { return ( !!arg && - (t.isStringLiteral(arg) || - (t.isTemplateLiteral(arg) && arg.expressions.length === 0)) + (is.StringLiteral(arg) || + (is.TemplateLiteral(arg) && arg.expressions.length === 0)) ) } @@ -314,33 +322,37 @@ function getRouteIdQuote( source: string, arg: SupportedRouteId, ): '"' | "'" | '`' { - const raw = source.slice(arg.start!, arg.end!) + const raw = source.slice(arg.start, arg.end) - if (raw.startsWith("'")) return "'" - if (raw.startsWith('"')) return '"' + if (raw.startsWith("'")) { + return "'" + } + if (raw.startsWith('"')) { + return '"' + } return '`' } function getCreateFileRouteProps( arg: t.CallExpression['arguments'][number] | undefined, ) { - if (!arg || !t.isObjectExpression(arg)) { + if (!arg || !is.ObjectExpression(arg)) { return undefined } const props = new Set() for (const property of arg.properties) { - if (!t.isObjectProperty(property) || property.computed) { + if (!is.Property(property) || property.computed) { continue } - if (t.isIdentifier(property.key)) { + if (is.Identifier(property.key)) { props.add(property.key.name) continue } - if (t.isStringLiteral(property.key)) { + if (is.StringLiteral(property.key)) { props.add(property.key.value) } } @@ -349,7 +361,7 @@ function getCreateFileRouteProps( } function parseTargetImports( - body: Array, + body: t.Program['body'], source: string, targetModule: string, ) { @@ -357,33 +369,30 @@ function parseTargetImports( for (const statement of body) { if ( - !t.isImportDeclaration(statement) || + !is.ImportDeclaration(statement) || statement.importKind === 'type' || statement.source.value !== targetModule ) { continue } - const rawSource = source.slice( - statement.source.start!, - statement.source.end!, - ) - const importStatement = source.slice(statement.start!, statement.end!) + const rawSource = source.slice(statement.source.start, statement.source.end) + const importStatement = source.slice(statement.start, statement.end) imports.push({ declaration: statement, defaultImport: statement.specifiers.find((specifier) => - t.isImportDefaultSpecifier(specifier), + is.ImportDefaultSpecifier(specifier), )?.local.name, namespace: statement.specifiers.find((specifier) => - t.isImportNamespaceSpecifier(specifier), + is.ImportNamespaceSpecifier(specifier), )?.local.name, named: statement.specifiers .filter((specifier): specifier is t.ImportSpecifier => - t.isImportSpecifier(specifier), + is.ImportSpecifier(specifier), ) .map((specifier) => ({ - imported: t.isIdentifier(specifier.imported) + imported: is.Identifier(specifier.imported) ? specifier.imported.name : specifier.imported.value, local: specifier.local.name, @@ -420,8 +429,8 @@ function updateRouteImports({ } if (analysis.kind === 'rename') { - s.update(analysis.imported.start!, analysis.imported.end!, analysis.next) - s.update(analysis.local.start!, analysis.local.end!, analysis.next) + s.update(analysis.imported.start, analysis.imported.end, analysis.next) + s.update(analysis.local.start, analysis.local.end, analysis.next) return true } @@ -452,12 +461,12 @@ function analyzeRouteImports( for (const declaration of imports) { for (const specifier of declaration.declaration.specifiers) { - if (!t.isImportSpecifier(specifier)) { + if (!is.ImportSpecifier(specifier)) { continue } const imported = specifier.imported - if (!t.isIdentifier(imported)) { + if (!is.Identifier(imported)) { return { kind: 'normalize' } } @@ -539,16 +548,16 @@ function normalizeRouteImports({ if (replacement === null) { s.remove( - declaration.declaration.start!, - getRemovalEnd(source, declaration.declaration.end!), + declaration.declaration.start, + getRemovalEnd(source, declaration.declaration.end), ) modified = true continue } s.update( - declaration.declaration.start!, - declaration.declaration.end!, + declaration.declaration.start, + declaration.declaration.end, replacement, ) modified = true diff --git a/packages/router-generator/tests/transform.test.ts b/packages/router-generator/tests/transform.test.ts index f026ecc30e6..3ae54283f0b 100644 --- a/packages/router-generator/tests/transform.test.ts +++ b/packages/router-generator/tests/transform.test.ts @@ -434,9 +434,7 @@ describe('transform', () => { if (result.result !== 'error') { throw new Error(`expected error result, got ${result.result}`) } - expect(String(result.error)).toContain( - 'expected exactly one createFileRoute/createLazyFileRoute call', - ) + expect(String(result.error)).toContain("Duplicate export of 'Route'") }) it('prepends a new import when no target-module import exists', async () => { diff --git a/packages/router-plugin/ARCHITECTURE-CODE-SPLITTING.md b/packages/router-plugin/ARCHITECTURE-CODE-SPLITTING.md index b3016930784..e7fd304d03a 100644 --- a/packages/router-plugin/ARCHITECTURE-CODE-SPLITTING.md +++ b/packages/router-plugin/ARCHITECTURE-CODE-SPLITTING.md @@ -1,7 +1,7 @@ # Automatic Code-Splitting Architecture > Internal documentation for the TanStack Router code-splitting system. -> This covers the Babel-based transform pipeline that splits route files into +> This covers the Yuku-based transform pipeline that splits route files into > lazily-loaded modules (typically separate chunks) at build time. --- @@ -115,9 +115,25 @@ returns an **array of 3 plugins** that share a closure containing: - `sharedBindingsMap: Map>` — maps normalized file paths to their computed shared binding names +- `analyzedRoutes` — bounded LRU of immutable Yuku source analysis, reused by + grouping detection, shared ownership, and output generation - `userConfig` — resolved plugin configuration - Helper functions for grouping resolution +### Immutable analysis and output ownership + +`analyzeRouteModule()` parses and resolves bindings with Yuku once for a source +revision. It records route options, exports, and the dependency graph using +resolved symbol identities, so shadowed names and JSX references are distinct. +Each output gets its own AST copy with a map back to the original nodes. Output +mutation never changes the original semantic snapshot. + +The plugin caches at most 128 analyses. Keys retain module query parameters +other than `tsr-split` and `tsr-shared`; cached analysis is reused only when the +source text also matches. Grouping decisions and generated output are not +cached, so client/server configuration stays local to each transform. Changed +source replaces the entry, and `buildEnd` clears retained ASTs. + ### Plugin 1: `tanstack-router:code-splitter:compile-reference-file` **Filter:** File IDs matching `/\.(m|c)?(j|t)sx?$/` whose code contains one of @@ -157,8 +173,7 @@ Excludes file IDs that include `tsr-split` or `tsr-shared`. virtual file should export (e.g., `['component']`) 3. Reads shared bindings from `sharedBindingsMap` for the base file 4. Calls `compileCodeSplitVirtualRoute()` which: - - Removes shared binding declarations before traversal (prevents scope - collision crashes) + - Constructs an output tree using the immutable source analysis - Keeps only the intended split properties as named exports - Converts user-exported declarations to imports from the base file - Adds `import { ... } from '...?tsr-shared=1'` if shared bindings exist @@ -297,44 +312,17 @@ split modules import from, ensuring a single shared instance. **Algorithm:** -1. **Collect local bindings** — Cheap loop over `program.body` to find all - module-level `const`/`let`/`var`/`function`/`class` declarations. Deletes - `Route` from the set (must never be extracted). If no local bindings - remain, returns empty set immediately (fast path). - -2. **Find route options** — Uses `babel.traverse` to locate the - `createFileRoute('/')({ ... })` call and extract the options object. - -3. **Fast path: group count check** — Iterates over route option properties, - tracking whether any non-split properties exist, and counting distinct - split group indices. - - If there are no non-split properties and fewer than 2 split groups are - present, nothing can be shared and it returns an empty set. - -4. **Build dependency graph** — `buildDependencyGraph()` creates a map from - each local binding to the set of other local bindings it references. Uses - `collectIdentifiersFromNode()` (a fast recursive walker, much cheaper than - `babel.traverse`) for each declaration. - -5. **Attribute bindings to groups** — For each route option property: - - Collects direct module-level references from the property value - - Expands transitively via the dependency graph (BFS) - - Records which group index each binding belongs to - -6. **Identify shared bindings** — Any binding appearing in 2+ distinct groups - is shared. - -7. **Handle destructured declarators** — If bindings from the same - `const { a, b } = fn()` appear in different groups, the entire declarator - must be shared (can't split the initialization). - -8. **Expand destructured declarations** — If any binding in a destructured - pattern is shared, all bindings in that pattern must be shared. - -9. **Remove Route-dependent bindings** — `removeBindingsDependingOnRoute()` - builds a reverse dependency graph, walks backwards from `Route` via BFS, - and removes any shared binding that transitively depends on `Route`. This - prevents Route duplication in the shared module. +1. Use the analyzed module's root-scope symbols and resolved declarations. + Imports and the `Route` singleton cannot be extracted. +2. Attribute each route property to a split group, or group `-1` for eager + properties. Ignore fallback values and the grouping configuration itself. +3. Collect runtime references using Yuku's resolved references, excluding + type-only positions and locally shadowed bindings. Follow transitive + declaration dependencies without following `Route` into the whole route. +4. Extract symbols reached from at least two groups. Bindings from one + destructured initializer form one unit, including unreferenced siblings. +5. Exclude every symbol that transitively depends on `Route`, including its + destructured siblings, to preserve the single reference-module instance. ### Concrete Example @@ -547,10 +535,10 @@ eliminated. **Key steps:** -1. Parse AST, collect `findReferencedIdentifiers()` for DCE +1. Reuse source analysis and clone an output tree with semantic provenance 2. For each split-able property in route options: - Check if the value is exported (if so, skip splitting — warn user) - - Generate a dynamic import URL: `addSplitSearchParamToFilename()` + - Generate a dynamic import URL: `splitFilename()` - Create importer: `const $$splitComponentImporter = () => import('...')` - Replace property value with `lazyRouteComponent(importer, 'component')` or `lazyFn(importer, 'loader')` @@ -559,7 +547,7 @@ eliminated. - Remove shared declarations from AST - Add `import { ... } from '...?tsr-shared=1'` - Re-export user-exported shared bindings -5. Run `deadCodeElimination()` +5. Run `removeUnusedBindings()` 6. Generate output code with source maps ### `compileCodeSplitVirtualRoute()` @@ -574,16 +562,15 @@ shared bindings set. **Key steps:** -1. Parse AST, collect referenced identifiers -2. **Remove shared declarations first** (before `babel.traverse`) — critical - to avoid `checkBlockScopedCollisions` crashes +1. Reuse source analysis and clone an output tree +2. Resolve shared declaration ownership against the original symbols 3. Track split-able nodes and their metadata 4. For each intended split target: - Resolve the property value through bindings - Create a named export (e.g., `export { SplitComponent as component }`) 5. Convert remaining user exports to imports from the base file 6. Add shared bindings import if applicable -7. Run `deadCodeElimination()` +7. Run `removeUnusedBindings()` 8. Strip orphaned expression statements 9. Generate output with source maps @@ -599,14 +586,14 @@ transitive dependencies. **Key steps:** -1. Parse AST, collect referenced identifiers +1. Reuse source analysis and clone an output tree 2. Build dependency graph, expand shared bindings transitively 3. Filter `program.body` to keep only: - Import declarations (DCE removes unused ones) - Declarations of bindings in the keep set 4. Strip `export` wrappers from kept declarations 5. Add `export { ... }` for all shared bindings -6. Run `deadCodeElimination()` +6. Run `removeUnusedBindings()` 7. Generate output with source maps ### `computeSharedBindings()` @@ -624,100 +611,57 @@ Traverses the AST looking for a `codeSplitGroupings` property on the route options object (supports both `createFileRoute` and `createRoute` call sites). If found, extracts the array-of-arrays value and returns it. -### Helper Functions - -| Function | Purpose | -| --------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `collectIdentifiersFromNode()` | Fast recursive walker to collect referenced identifier names from any AST node. Cheaper than `babel.traverse`. | -| `buildDeclarationMap()` | Maps binding name → AST declaration node for all module-level declarations. | -| `buildDependencyGraph()` | Maps binding name → set of other local bindings it references. | -| `expandTransitively()` | BFS expansion of a set through a dependency graph. | -| `removeBindingsDependingOnRoute()` | Reverse-graph BFS from `Route` to find and remove dependents. | -| `expandDestructuredDeclarations()` | If any binding in a destructured pattern is shared, mark all as shared. | -| `expandSharedDestructuredDeclarators()` | If bindings from same declarator appear in different groups, mark declarator as shared. | -| `collectLocalBindingsFromStatement()` | Collects locally-declared names from a statement (cheap, no traversal). | -| `collectModuleLevelRefsFromNode()` | Intersects `collectIdentifiersFromNode()` with local module-level bindings. | -| `removeSharedDeclarations()` | Filters shared binding declarations out of `program.body`. | -| `findExportedSharedBindings()` | Finds which shared bindings have `export` in the original source. | +### Native helpers + +| Function | Purpose | +| --------------------------- | --------------------------------------------------------------------------------------------- | +| `analyzeRouteModule()` | Build the immutable route syntax and semantic model. | +| `moduleDeclarationGraph()` | Map resolved symbols to declaration units and runtime dependencies. | +| `collectModuleReferences()` | Collect actual module-scope references, including JSX and excluding shadowed/type-only names. | +| `expandTransitively()` | Return a dependency closure without mutating its input. | +| `cloneModuleAst()` | Create an output AST and preserve original-node provenance. | +| `removeUnusedBindings()` | Retain output dependencies using surviving semantic references. | +| `generateModule()` | Print native ASTs with Yuku and original-source maps. | --- ## Dead Code Elimination -After each compiler transforms the AST, it runs `deadCodeElimination()` from -`@tanstack/router-utils`. This is critical because: - -- The reference file no longer uses the component implementation (it was - replaced with a lazy wrapper), so the original component code and its - dependencies should be stripped. -- The virtual file only exports specific properties, so everything else - (loader, beforeLoad, other components) should be stripped. -- The shared file only keeps shared bindings, so everything else should be - stripped. - -### How It Works - -1. **`findReferencedIdentifiers(ast)`** — Collects all `Identifier` NodePaths - in the AST that are in a "referenced" position (not binding sites). Returns - a `Set`. - -2. **`deadCodeElimination(ast, refIdents)`** — Iterates over all bindings in - the program scope. For each binding, checks whether any of its references - are in `refIdents`. If not, the binding is unreferenced and its declaration - is removed. Repeats until no more bindings can be removed (handles chains - where removing one binding makes another unreferenced). - -### Import Registration for DCE - -When the compilers add new imports (for shared bindings, or convert exports -to imports in virtual files), they must register the import specifier locals -in `refIdents` so DCE can later decide whether to keep or remove them: - -```ts -sharedImportPath.traverse({ - Identifier(identPath) { - if (identPath.parentPath.isImportSpecifier() && identPath.key === 'local') { - refIdents.add(identPath) - } - }, -}) -``` - -Without this, DCE would have no path references for the new imports and would -always remove them. +Each compiler first decides which declarations belong to its output, then calls +`removeUnusedBindings()` from `@tanstack/router-utils`. This reconstructs +liveness from **surviving** references in the output tree; the original semantic +tables are never assumed to update after mutation. -### Post-DCE Cleanup in Virtual Files +Source nodes retain their original symbol identity through the clone map. +Compiler-created references explicitly identify their intended symbol/name via +`linkGeneratedReference()`. Parsed compiler snippets carry native reference +provenance too. This avoids treating a new local or property name as a reference +to an unrelated original binding. -DCE only removes unused **declarations**. Bare side-effect statements like -`console.log(...)` survive even when no locally-bound names reference them. -The virtual compiler has an additional cleanup pass: +Exports and top-level effects seed liveness. Dependency closure keeps nested +captures and whole destructured initializers together. Originally unused user +declarations remain in the reference output rather than silently discarding +intentional initializers; shared output retains only its explicitly owned +bindings and dependencies. Unused original and generated imports are removed. -```ts -ast.program.body = ast.program.body.filter((stmt) => { - if (!t.isExpressionStatement(stmt)) return true - const refs = collectIdentifiersFromNode(stmt) - return [...refs].some((name) => locallyBound.has(name)) -}) -``` +Standalone source effects stay in the reference module. Virtual outputs remove +expression statements that do not belong to their retained local declarations; +shared outputs include declarations rather than duplicating standalone effects. -This strips expression statements that don't reference any locally-bound name. +Directive prologues remain at the beginning of nonempty outputs: injected imports +and lazy helpers are inserted after them. A virtual output containing only +directives is empty. Code generation preserves comments/annotations and uses the +original source spans for source maps. -### Directive Prologue Handling - -If the file body is empty after DCE (virtual file where no properties matched), -directive prologues (`'use client'`, `'use strict'`) are also stripped: - -```ts -if (ast.program.body.length === 0) { - ast.program.directives = [] -} -``` +Framework compiler hooks receive native programs, source modules, and explicit +insertion/renaming operations. They no longer receive Babel node paths or scope +objects. --- ## Framework Support -The code-splitting system is framework-agnostic at the Babel transform level. +The code-splitting system is framework-agnostic at the native AST transform level. Framework differences are confined to `framework-options.ts`: | Framework | Package | `createFileRoute` | `lazyFn` | `lazyRouteComponent` | @@ -773,9 +717,8 @@ compiled output as a `console.warn` to make it obvious during local testing.) ### 2. Root Routes Are Never Split -`createRootRoute()` and `createRootRouteWithContext()` are in -`unsplittableCreateRouteFns`. The reference compiler adds HMR handling but -exits before attempting any code-splitting transforms. +Only `createFileRoute()` definitions enter the splitting phase. Root factories +still receive the framework's HMR handling. ### 3. `undefined`, `null`, and `boolean` Values Are Kept In-Place @@ -814,32 +757,24 @@ function useRouteStuff() { Even if `useRouteStuff` is referenced by multiple groups, it cannot be extracted to the shared module because it depends on `Route`. Extracting it would require `Route` in the shared module, duplicating the route singleton. -`removeBindingsDependingOnRoute()` handles this via reverse-graph BFS. - -### 6. `removeSharedDeclarations` Must Run Before `babel.traverse` in Virtual Files - -In `compileCodeSplitVirtualRoute()`, shared declarations are removed -**before** `babel.traverse` runs: +`computeSharedBindings()` excludes these bindings through the reverse dependency +graph, including their destructured declaration siblings. -```ts -if (opts.sharedBindings && opts.sharedBindings.size > 0) { - removeSharedDeclarations(ast, opts.sharedBindings) -} - -babel.traverse(ast, { ... }) -``` +### 6. Shared Imports Replace Their Original Declarations -If done after, Babel's scope analysis would see both the shared declaration -and the new shared import, causing a `checkBlockScopedCollisions` crash -(duplicate `const` binding in the same scope). +An output cannot retain both a shared declaration and its replacement import. +The compiler removes the complete original declaration, then adds the shared +import. All dependency decisions still use the immutable source module's +symbols; output clones are never analyzed while partially transformed. +Exports, including multiple aliases and quoted names, are redirected to the +same shared binding. ### 7. Directive Prologues Survive Code-Splitting -Babel stores directives (like `'use client'`) in `program.directives`, not -in `program.body`. They are preserved through all transforms automatically. -The only exception is when the body is completely empty after DCE — then -directives are stripped too (a file with just `'use client'` and no code is -useless). +Yuku represents directives (like `'use client'`) as expression statements with +directive metadata in `program.body`. Injected imports and helpers are placed +after the directive prologue. Shared and virtual output filtering explicitly +preserves directives; a virtual output with no other statements becomes empty. ### 8. Plugin Ordering in the Array Matters @@ -854,7 +789,7 @@ bindings. Import statements are handled by the bundler's module system — if both the reference file and a virtual file import the same external module, the bundler deduplicates that import automatically. No shared module needed. -### 10. `SPLIT_NODES_CONFIG` — Split Strategy per Property +### 10. Split Strategy per Property Each splittable property has a configured split strategy: diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json index affae0bab43..48e65163244 100644 --- a/packages/router-plugin/package.json +++ b/packages/router-plugin/package.json @@ -117,20 +117,18 @@ "node": ">=20.19" }, "dependencies": { - "@babel/core": "catalog:", - "@babel/template": "^7.29.7", - "@babel/types": "catalog:", "@tanstack/router-core": "workspace:*", "@tanstack/router-generator": "workspace:*", "@tanstack/router-utils": "workspace:*", "chokidar": "catalog:", "unplugin": "^3.3.0", - "zod": "catalog:" + "zod": "catalog:", + "@yuku-toolchain/types": "0.11.0", + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0" }, "devDependencies": { "@rsbuild/core": "catalog:", - "@types/babel__core": "^7.20.5", - "@types/babel__template": "^7.4.4", "@types/node": ">=20", "@tanstack/vite-config": "catalog:", "vitest": "catalog:", diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts index 89cdae41add..1caa6789e51 100644 --- a/packages/router-plugin/src/core/code-splitter/compilers.ts +++ b/packages/router-plugin/src/core/code-splitter/compilers.ts @@ -1,1721 +1,1017 @@ -import * as t from '@babel/types' -import * as babel from '@babel/core' -import * as template from '@babel/template' +import { b, bindingIdentifiers, is, isIdentifierName, walk } from 'yuku-ast' +import { SymbolFlags } from 'yuku-analyzer' import { - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromPattern, - collectLocalBindingsFromStatement, - collectModuleLevelRefsFromNode, + analyzeModule, + cloneModuleAst, + collectModuleReferences, createIdentifier, - deadCodeElimination, - expandDestructuredDeclarations, - expandSharedDestructuredDeclarators, expandTransitively, - findReferencedIdentifiers, - generateFromAst, - parseAst, - removeBindingsTransitivelyDependingOn, - retainModuleLevelDeclarations, - stripUnreferencedTopLevelExpressionStatements, - unwrapExportedDeclarations, + generateModule, + linkGeneratedReference, + moduleDeclarationGraph, + parseStatements, + removeUnusedBindings, + unwrapExpression, } from '@tanstack/router-utils' import { tsrShared, tsrSplit } from '../constants' import { createRouteHmrStatement } from '../hmr' -import { getObjectPropertyKeyName } from '../utils' +import { getObjectPropertyKeyName, getUniqueProgramIdentifier } from '../utils' import { getFrameworkOptions } from './framework-options' +import type { Module, Symbol } from 'yuku-analyzer' +import type { + Expression, + Node, + ObjectExpression, + ObjectProperty, + Program, + ProgramStatement, + StringLiteral, +} from '@yuku-toolchain/types' +import type { AnalyzeModuleOptions } from '@tanstack/router-utils' import type { CodeSplitCompilerPlugin, CompileCodeSplitReferenceRouteOptions, + ReferenceRouteCompilerPluginContext, } from './plugins' -import type { GeneratorResult, ParseAstOptions } from '@tanstack/router-utils' import type { CodeSplitGroupings, SplitRouteIdentNodes } from '../constants' import type { SplitNodeMeta } from './types' -export { - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromNode, - collectLocalBindingsFromStatement, - collectModuleLevelRefsFromNode, - expandDestructuredDeclarations, - expandSharedDestructuredDeclarators, - expandTransitively, - removeBindingsTransitivelyDependingOn, -} from '@tanstack/router-utils' - -export function removeBindingsDependingOnRoute( - bindings: Set, - dependencyGraph: Map>, -) { - removeBindingsTransitivelyDependingOn(bindings, dependencyGraph, ['Route']) -} - -const SPLIT_NODES_CONFIG = new Map([ - [ - 'loader', - { - routeIdent: 'loader', - localImporterIdent: '$$splitLoaderImporter', // const $$splitLoaderImporter = () => import('...') - splitStrategy: 'lazyFn', - localExporterIdent: 'SplitLoader', // const SplitLoader = ... - exporterIdent: 'loader', // export { SplitLoader as loader } - }, - ], - [ - 'component', - { - routeIdent: 'component', - localImporterIdent: '$$splitComponentImporter', // const $$splitComponentImporter = () => import('...') - splitStrategy: 'lazyRouteComponent', - localExporterIdent: 'SplitComponent', // const SplitComponent = ... - exporterIdent: 'component', // export { SplitComponent as component } - }, - ], - [ - 'pendingComponent', - { - routeIdent: 'pendingComponent', - localImporterIdent: '$$splitPendingComponentImporter', // const $$splitPendingComponentImporter = () => import('...') - splitStrategy: 'lazyRouteComponent', - localExporterIdent: 'SplitPendingComponent', // const SplitPendingComponent = ... - exporterIdent: 'pendingComponent', // export { SplitPendingComponent as pendingComponent } - }, - ], - [ - 'errorComponent', - { - routeIdent: 'errorComponent', - localImporterIdent: '$$splitErrorComponentImporter', // const $$splitErrorComponentImporter = () => import('...') - splitStrategy: 'lazyRouteComponent', - localExporterIdent: 'SplitErrorComponent', // const SplitErrorComponent = ... - exporterIdent: 'errorComponent', // export { SplitErrorComponent as errorComponent } - }, - ], - [ - 'notFoundComponent', - { - routeIdent: 'notFoundComponent', - localImporterIdent: '$$splitNotFoundComponentImporter', // const $$splitNotFoundComponentImporter = () => import('...') - splitStrategy: 'lazyRouteComponent', - localExporterIdent: 'SplitNotFoundComponent', // const SplitNotFoundComponent = ... - exporterIdent: 'notFoundComponent', // export { SplitNotFoundComponent as notFoundComponent } - }, - ], +const splitKeys: Array = [ + 'loader', + 'component', + 'pendingComponent', + 'errorComponent', + 'notFoundComponent', +] +const factoryNames = new Set([ + 'createFileRoute', + 'createRoute', + 'createRootRoute', + 'createRootRouteWithContext', ]) -const KNOWN_SPLIT_ROUTE_IDENTS = [...SPLIT_NODES_CONFIG.keys()] as const - -function addSplitSearchParamToFilename( - filename: string, - grouping: Array, -) { - const [bareFilename] = filename.split('?') - - const params = new URLSearchParams() - params.append(tsrSplit, createIdentifier(grouping)) +function splitMeta(key: SplitRouteIdentNodes): SplitNodeMeta { + const capitalized = `${key[0]!.toUpperCase()}${key.slice(1)}` + return { + routeIdent: key, + localImporterIdent: `$$split${capitalized}Importer`, + splitStrategy: key === 'loader' ? 'lazyFn' : 'lazyRouteComponent', + localExporterIdent: `Split${capitalized}`, + exporterIdent: key, + } +} - const result = `${bareFilename}?${params.toString()}` - return result +function bareFilename(filename: string) { + return filename.split('?')[0]! } -function removeSplitSearchParamFromFilename(filename: string) { - const [bareFilename] = filename.split('?') - return bareFilename! +function splitFilename(filename: string, grouping: Array) { + return `${bareFilename(filename)}?${tsrSplit}=${createIdentifier(grouping)}` } export function addSharedSearchParamToFilename(filename: string) { - const [bareFilename] = filename.split('?') - return `${bareFilename}?${tsrShared}=1` + return `${bareFilename(filename)}?${tsrShared}=1` } -const splittableCreateRouteFns = ['createFileRoute'] -const unsplittableCreateRouteFns = [ - 'createRootRoute', - 'createRootRouteWithContext', -] -const allCreateRouteFns = [ - ...splittableCreateRouteFns, - ...unsplittableCreateRouteFns, -] - -/** - * Computes module-level bindings that are shared between split and non-split - * route properties. These bindings need to be extracted into a shared virtual - * module to avoid double-initialization. - * - * A binding is "shared" if it is referenced by at least one split property - * AND at least one non-split property. Only locally-declared module-level - * bindings are candidates (not imports — bundlers dedupe those). - */ -export function computeSharedBindings(opts: { - code: string - filename?: string - codeSplitGroupings: CodeSplitGroupings -}): Set { - const ast = parseAst(opts) +type RouteDefinition = { + options: ObjectExpression + factory: string + statement: Node +} - // Early bailout: collect all module-level locally-declared binding names. - // This is a cheap loop over program.body (no traversal). If the file has - // no local bindings (aside from `Route`), nothing can be shared — skip - // the expensive babel.traverse entirely. - const localModuleLevelBindings = new Set() - for (const node of ast.program.body) { - collectLocalBindingsFromStatement(node, localModuleLevelBindings) - } +/** Source syntax and semantic identities are immutable across all output chunks. */ +export type RouteModuleAnalysis = { + module: Module + routes: Array + graph: ReturnType + exported: Map> +} - // File-based routes always export a route config binding (usually `Route`). - // This must never be extracted into the shared module. - localModuleLevelBindings.delete('Route') +type SourceOptions = AnalyzeModuleOptions & { analysis?: RouteModuleAnalysis } - if (localModuleLevelBindings.size === 0) { - return new Set() +function resolveExpression( + module: Module, + node: Node | null | undefined, + seen = new Set(), +): Node | undefined { + if (!node) { + return undefined } - - function findIndexForSplitNode(str: string) { - return opts.codeSplitGroupings.findIndex((group) => - group.includes(str as any), - ) + if (is.Expression(node)) { + node = unwrapExpression(node) } + if (is.Identifier(node)) { + const symbol = module.symbolOf(node) + if (!symbol || seen.has(symbol)) { + return undefined + } + seen.add(symbol) + let declaration: Node | null | undefined = symbol.declarations[0] + while ( + declaration && + !is.VariableDeclarator(declaration) && + !is.Program(declaration) + ) { + declaration = module.parentOf(declaration) + } + if (is.VariableDeclarator(declaration) && is.Identifier(declaration.id)) { + return resolveExpression(module, declaration.init, seen) + } + return undefined + } + return node +} - // Find the route options object — needs babel.traverse for scope resolution - let routeOptions: t.ObjectExpression | undefined - - babel.traverse(ast, { - CallExpression(path) { - if (!t.isIdentifier(path.node.callee)) return - if (!splittableCreateRouteFns.includes(path.node.callee.name)) return - - if (t.isCallExpression(path.parentPath.node)) { - const opts = resolveIdentifier(path, path.parentPath.node.arguments[0]) - if (t.isObjectExpression(opts)) routeOptions = opts - } else if (t.isVariableDeclarator(path.parentPath.node)) { - const caller = resolveIdentifier(path, path.parentPath.node.init) - if (t.isCallExpression(caller)) { - const opts = resolveIdentifier(path, caller.arguments[0]) - if (t.isObjectExpression(opts)) routeOptions = opts - } +export function analyzeRouteModule( + options: AnalyzeModuleOptions, +): RouteModuleAnalysis { + const module = analyzeModule(options) + const routes: Array = [] + const seen = new Set() + module.walk({ + CallExpression(node) { + const outerCallee = unwrapExpression(node.callee) + const callee = unwrapExpression( + is.CallExpression(outerCallee) ? outerCallee.callee : outerCallee, + ) + if (!is.Identifier(callee) || !factoryNames.has(callee.name)) { + return } + const options = resolveExpression(module, node.arguments[0]) + if (!is.ObjectExpression(options) || seen.has(options)) { + return + } + seen.add(options) + let statement: Node = node + let parent = module.parentOf(statement) + while (parent && !is.Program(parent)) { + statement = parent + parent = module.parentOf(statement) + } + routes.push({ options, factory: callee.name, statement }) }, }) - - if (!routeOptions) return new Set() - - // Fast path: if fewer than 2 distinct groups are referenced by route options, - // nothing can be shared and we can skip the rest of the work. - const splitGroupsPresent = new Set() - let hasNonSplit = false - for (const prop of routeOptions.properties) { - if (!t.isObjectProperty(prop)) continue - const key = getObjectPropertyKeyName(prop) - if (!key) continue - if (key === 'codeSplitGroupings') continue - if (t.isIdentifier(prop.value) && prop.value.name === 'undefined') continue - const groupIndex = findIndexForSplitNode(key) // -1 if non-split - if (groupIndex === -1) { - hasNonSplit = true - } else { - splitGroupsPresent.add(groupIndex) + const exported = new Map>() + const { exports: moduleExports } = module + for (const entry of moduleExports) { + if (entry.local && entry.name !== null && !entry.typeOnly) { + const names = exported.get(entry.local) ?? [] + if (!names.includes(entry.name)) { + names.push(entry.name) + } + exported.set(entry.local, names) } } + return { module, routes, graph: moduleDeclarationGraph(module), exported } +} - if (!hasNonSplit && splitGroupsPresent.size < 2) return new Set() - - // Build dependency graph up front — needed for transitive expansion per-property. - // This graph excludes `Route` (deleted above) so group attribution works correctly. - const declMap = buildDeclarationMap(ast) - const depGraph = buildDependencyGraph(declMap, localModuleLevelBindings) - - // Build a second dependency graph that includes `Route` so we can detect - // bindings that transitively depend on it. Such bindings must NOT be - // extracted into the shared module because they would drag the Route - // singleton with them, duplicating it across modules. - const allLocalBindings = new Set(localModuleLevelBindings) - allLocalBindings.add('Route') - const fullDepGraph = buildDependencyGraph(declMap, allLocalBindings) - - // For each route property, track which "group" it belongs to. - // Non-split properties get group index -1. - // Split properties get their codeSplitGroupings index (0, 1, ...). - // A binding is "shared" if it appears in 2+ distinct groups. - // We expand each property's refs transitively BEFORE comparing groups, - // so indirect refs (e.g., component: MyComp where MyComp uses `shared`) - // are correctly attributed. - const refsByGroup = new Map>() +function sourceAnalysis(options: SourceOptions) { + return options.analysis ?? analyzeRouteModule(options) +} - for (const prop of routeOptions.properties) { - if (!t.isObjectProperty(prop)) continue - const key = getObjectPropertyKeyName(prop) - if (!key) continue +function isFallback(value: Expression) { + value = unwrapExpression(value) + return ( + (is.Literal(value) && + (value.value === null || typeof value.value === 'boolean')) || + (is.Identifier(value) && value.name === 'undefined') + ) +} - if (key === 'codeSplitGroupings') continue +function properties(route: RouteDefinition) { + return route.options.properties.filter( + (property): property is ObjectProperty => is.Property(property), + ) +} - const groupIndex = findIndexForSplitNode(key) // -1 if non-split +function isDataProperty(property: ObjectProperty) { + return !property.method && property.kind === 'init' +} - const directRefs = collectModuleLevelRefsFromNode( - prop.value, - localModuleLevelBindings, +/** Assign each initializer and its dependencies to the chunks that consume it. */ +export function computeSharedBindings( + options: SourceOptions & { codeSplitGroupings: CodeSplitGroupings }, +): Set { + const analysis = sourceAnalysis(options) + const { module, graph } = analysis + const groupsBySymbol = new Map>() + const chunkDependencies = new Map( + [...graph.dependencies].map(([symbol, dependencies]) => [ + symbol, + new Set( + [...dependencies].filter((dependency) => dependency.name !== 'Route'), + ), + ]), + ) + const locals = new Set( + module.rootScope.bindings.filter( + (symbol) => symbol.name !== 'Route' && !symbol.has(SymbolFlags.Import), + ), + ) + for (const route of analysis.routes) { + if (route.factory !== 'createFileRoute') { + continue + } + for (const property of properties(route)) { + const key = getObjectPropertyKeyName(property) + if (!key || key === 'codeSplitGroupings' || isFallback(property.value)) { + continue + } + const group = isDataProperty(property) + ? options.codeSplitGroupings.findIndex((keys) => + keys.includes(key as SplitRouteIdentNodes), + ) + : -1 + const references = expandTransitively( + collectModuleReferences(module, property.value), + chunkDependencies, + ) + for (const symbol of references) { + if (!locals.has(symbol)) { + continue + } + const groups = groupsBySymbol.get(symbol) ?? new Set() + groups.add(group) + groupsBySymbol.set(symbol, groups) + } + } + } + const shared = new Set() + for (const [symbol, groups] of groupsBySymbol) { + if (groups.size > 1) { + shared.add(symbol) + } + } + // A destructured initializer belongs to one module even when its individual + // bindings are used in different chunks. + for (const siblings of graph.declarationSymbols.values()) { + const groups = new Set( + [...siblings].flatMap((symbol) => [ + ...(groupsBySymbol.get(symbol) ?? []), + ]), ) - - // Expand transitively: if component references SharedComp which references - // `shared`, then `shared` is also attributed to component's group. - const allRefs = new Set(directRefs) - expandTransitively(allRefs, depGraph) - - for (const ref of allRefs) { - let groups = refsByGroup.get(ref) - if (!groups) { - groups = new Set() - refsByGroup.set(ref, groups) + if (groups.size > 1 || [...siblings].some((symbol) => shared.has(symbol))) { + for (const symbol of siblings) { + if (locals.has(symbol)) { + shared.add(symbol) + } } - groups.add(groupIndex) } } - - // Shared = bindings appearing in 2+ distinct groups - const shared = new Set() - for (const [name, groups] of refsByGroup) { - if (groups.size >= 2) shared.add(name) + const forbidden = new Set( + module.rootScope.bindings.filter((symbol) => symbol.name === 'Route'), + ) + let changed = true + while (changed) { + changed = false + for (const [symbol, dependencies] of graph.dependencies) { + if ( + !forbidden.has(symbol) && + [...dependencies].some((dependency) => forbidden.has(dependency)) + ) { + forbidden.add(symbol) + changed = true + } + } + for (const siblings of graph.declarationSymbols.values()) { + if ([...siblings].some((symbol) => forbidden.has(symbol))) { + for (const symbol of siblings) { + if (!forbidden.has(symbol)) { + forbidden.add(symbol) + changed = true + } + } + } + } } + return new Set( + [...shared] + .filter((symbol) => !forbidden.has(symbol)) + .map((symbol) => symbol.name), + ) +} - // Destructured declarators (e.g. `const { a, b } = fn()`) must be treated - // as a single initialization unit. Even if each binding is referenced by - // only one group, if *different* bindings from the same declarator are - // referenced by different groups, the declarator must be extracted to the - // shared module to avoid double initialization. - expandSharedDestructuredDeclarators(ast, refsByGroup, shared) - - if (shared.size === 0) return shared - - // If any binding from a destructured declaration is shared, - // all bindings from that declaration must be shared - expandDestructuredDeclarations(ast, shared) - - // Remove shared bindings that transitively depend on `Route`. - // The Route singleton must stay in the reference file; extracting a - // binding that references it would duplicate Route in the shared module. - removeBindingsTransitivelyDependingOn(shared, fullDepGraph, ['Route']) - - return shared +function identifier(name: string) { + return b.Identifier({ name }) +} +function reference(name: string, symbol?: Symbol) { + const node = identifier(name) + linkGeneratedReference(node, symbol ?? name) + return node +} +function string(value: string) { + return b.Literal({ value, raw: JSON.stringify(value) }) as StringLiteral +} +function moduleName(name: string) { + return isIdentifierName(name) ? identifier(name) : string(name) +} +function imports( + names: Array<{ local: string; imported: string }>, + source: string, +) { + return b.ImportDeclaration({ + source: string(source), + attributes: [], + phase: null, + specifiers: names.map(({ local, imported }) => + b.ImportSpecifier({ + local: identifier(local), + imported: moduleName(imported), + }), + ), + }) +} +function exports( + names: Array<{ local: string; exported: string; symbol?: Symbol }>, + source: string | null = null, +) { + return b.ExportNamedDeclaration({ + declaration: null, + source: source === null ? null : string(source), + attributes: [], + specifiers: names.map(({ local, exported, symbol }) => + b.ExportSpecifier({ + local: source === null ? reference(local, symbol) : moduleName(local), + exported: moduleName(exported), + }), + ), + }) +} +function variable(name: string, init: Expression) { + return b.VariableDeclaration({ + kind: 'const', + declarations: [b.VariableDeclarator({ id: identifier(name), init })], + }) +} +function call(name: string, args: Array) { + return b.CallExpression({ + callee: reference(name), + arguments: args, + optional: false, + }) } -/** - * Find which shared bindings are user-exported in the original source. - * These need to be re-exported from the shared module. - */ -function findExportedSharedBindings( - ast: t.File, - sharedBindings: Set, -): Set { - const exported = new Set() - for (const stmt of ast.program.body) { - if (!t.isExportNamedDeclaration(stmt) || !stmt.declaration) continue +function prepend(program: Program, ...statements: Array) { + const firstStatement = program.body.findIndex( + (statement) => !is.Directive(statement), + ) + program.body.splice( + firstStatement === -1 ? program.body.length : firstStatement, + 0, + ...statements, + ) +} - if (t.isVariableDeclaration(stmt.declaration)) { - for (const decl of stmt.declaration.declarations) { - for (const name of collectIdentifiersFromPattern(decl.id)) { - if (sharedBindings.has(name)) exported.add(name) +function createOutput(analysis: RouteModuleAnalysis) { + const { program, originalNodes } = cloneModuleAst(analysis.module) + const copies = new Map() + walk(program, { + enter(node) { + copies.set(originalNodes.get(node)!, node) + }, + }) + const renameBinding = (node: Node, name: string) => { + const original = originalNodes.get(node) + const symbol = original ? analysis.module.symbolOf(original) : null + if (!symbol) { + return + } + const declarationExports = new Map() + for (const entry of analysis.module.exports) { + if (!entry.local || entry.name === null || entry.typeOnly) { + continue + } + let statement: Node = entry.node + let parent = analysis.module.parentOf(statement) + while (parent && !is.Program(parent)) { + statement = parent + parent = analysis.module.parentOf(statement) + } + if (is.ExportNamedDeclaration(statement) && statement.declaration) { + const entries = declarationExports.get(statement) ?? [] + declarationExports.set(statement, [...entries, entry]) + } + } + const aliasedNames = new Set() + for (const [statement, entries] of declarationExports) { + const copy = copies.get(statement) + if ( + !entries.some((entry) => entry.local === symbol) || + !is.ExportNamedDeclaration(copy) || + !copy.declaration + ) { + continue + } + const index = program.body.indexOf(copy) + if (index !== -1) { + const uniqueEntries = entries.filter((entry) => { + if (aliasedNames.has(entry.name!)) { + return false + } + aliasedNames.add(entry.name!) + return true + }) + const aliases = exports( + uniqueEntries.map((entry) => ({ + local: entry.local!.name, + exported: entry.name!, + symbol: entry.local!, + })), + ) + for (const [index, entry] of uniqueEntries.entries()) { + originalNodes.set(aliases.specifiers[index]!.local, entry.node) } + program.body.splice( + index, + 1, + copy.declaration, + ...(uniqueEntries.length ? [aliases] : []), + ) } - } else if ( - t.isFunctionDeclaration(stmt.declaration) && - stmt.declaration.id - ) { - if (sharedBindings.has(stmt.declaration.id.name)) - exported.add(stmt.declaration.id.name) - } else if (t.isClassDeclaration(stmt.declaration) && stmt.declaration.id) { - if (sharedBindings.has(stmt.declaration.id.name)) - exported.add(stmt.declaration.id.name) } + walk(program, { + enter(candidate, context) { + if (!is.Identifier(candidate) && !is.JSXIdentifier(candidate)) { + return + } + const source = originalNodes.get(candidate) + if (source && analysis.module.symbolOf(source) === symbol) { + candidate.name = name + const parent = context.parent + if ( + is.Property(parent) && + parent.shorthand && + is.Identifier(parent.key) && + is.Identifier(parent.value) && + parent.key.name !== parent.value.name + ) { + parent.shorthand = false + } + } + }, + }) } - return exported + return { program, originalNodes, copies, renameBinding } } -/** - * Remove declarations of shared bindings from the AST. - * Handles both plain and exported declarations, including destructured patterns. - * Removes the entire statement if all bindings in it are shared. - */ -function removeSharedDeclarations(ast: t.File, sharedBindings: Set) { - ast.program.body = ast.program.body.filter((stmt) => { - const decl = - t.isExportNamedDeclaration(stmt) && stmt.declaration - ? stmt.declaration - : stmt - - if (t.isVariableDeclaration(decl)) { - // Filter out declarators where all bound names are shared - decl.declarations = decl.declarations.filter((declarator) => { - const names = collectIdentifiersFromPattern(declarator.id) - return !names.every((n) => sharedBindings.has(n)) - }) - // If no declarators remain, remove the entire statement - if (decl.declarations.length === 0) return false - } else if (t.isFunctionDeclaration(decl) && decl.id) { - if (sharedBindings.has(decl.id.name)) return false - } else if (t.isClassDeclaration(decl) && decl.id) { - if (sharedBindings.has(decl.id.name)) return false - } - - return true +function removeDeclarations(program: Program, names: Set) { + const removedDefaultExports = new Set() + walk(program, { + enter(node, context) { + if ( + (is.TSEnumDeclaration(node) || + is.TSModuleDeclaration(node) || + is.TSDeclareFunction(node)) && + node.id && + is.Identifier(node.id) && + names.has(node.id.name) && + (is.Program(context.parent) || + is.ExportNamedDeclaration(context.parent)) + ) { + context.remove() + } + }, + VariableDeclarator(node, context) { + const container = context.ancestors().at(-2) + if (!is.Program(container) && !is.ExportNamedDeclaration(container)) { + return + } + if (bindingIdentifiers(node.id).every((id) => names.has(id.name))) { + context.remove() + } + }, + FunctionDeclaration(node, context) { + if ( + node.id && + names.has(node.id.name) && + (is.Program(context.parent) || + is.ExportNamedDeclaration(context.parent) || + is.ExportDefaultDeclaration(context.parent)) + ) { + if (is.ExportDefaultDeclaration(context.parent)) { + removedDefaultExports.add(context.parent) + } + context.remove() + } + }, + ClassDeclaration(node, context) { + if ( + node.id && + names.has(node.id.name) && + (is.Program(context.parent) || + is.ExportNamedDeclaration(context.parent) || + is.ExportDefaultDeclaration(context.parent)) + ) { + if (is.ExportDefaultDeclaration(context.parent)) { + removedDefaultExports.add(context.parent) + } + context.remove() + } + }, + leave(node, context) { + if ( + (is.VariableDeclaration(node) && node.declarations.length === 0) || + (is.ExportNamedDeclaration(node) && + !node.declaration && + node.specifiers.length === 0 && + !node.source) || + removedDefaultExports.has(node) + ) { + context.remove() + } + }, }) } +function addSharedImports( + program: Program, + shared: Set | undefined, + filename: string, +) { + if (shared?.size) { + removeDeclarations(program, shared) + prepend( + program, + imports( + [...shared].map((name) => ({ local: name, imported: name })), + addSharedSearchParamToFilename(filename), + ), + ) + } +} + export function compileCodeSplitReferenceRoute( - opts: ParseAstOptions & + options: SourceOptions & CompileCodeSplitReferenceRouteOptions & { compilerPlugins?: Array }, -): GeneratorResult | null { - const ast = parseAst(opts) - - const refIdents = findReferencedIdentifiers(ast) - - const knownExportedIdents = new Set() - - function findIndexForSplitNode(str: string) { - return opts.codeSplitGroupings.findIndex((group) => - group.includes(str as any), - ) - } - - const frameworkOptions = getFrameworkOptions(opts.targetFramework) - const PACKAGE = frameworkOptions.package - const LAZY_ROUTE_COMPONENT_IDENT = frameworkOptions.idents.lazyRouteComponent - const LAZY_FN_IDENT = frameworkOptions.idents.lazyFn - const stableRouteOptionKeys = [ - ...new Set( - (opts.compilerPlugins ?? []).flatMap( - (plugin) => plugin.getStableRouteOptionKeys?.() ?? [], - ), - ), - ] - - let createRouteFn: string - - let modified = false as boolean - let hmrAdded = false as boolean - let sharedExportedNames: Set | undefined - babel.traverse(ast, { - Program: { - enter(programPath) { - /** - * If the component for the route is being imported from - * another file, this is to track the path to that file - * the path itself doesn't matter, we just need to keep - * track of it so that we can remove it from the imports - * list if it's not being used like: - * - * `import '../shared/imported'` - */ - const removableImportPaths = new Set([]) - - programPath.traverse({ - CallExpression: (path) => { - if (!t.isIdentifier(path.node.callee)) { - return - } - - if (!allCreateRouteFns.includes(path.node.callee.name)) { - return - } - - createRouteFn = path.node.callee.name - - function babelHandleReference(routeOptions: t.Node | undefined) { - const hasImportedOrDefinedIdentifier = (name: string) => { - return programPath.scope.hasBinding(name) - } - - const addRouteHmr = ( - insertionPath: babel.NodePath, - routeOptions: t.ObjectExpression, - ) => { - if (!opts.addHmr || hmrAdded) { - return - } - - opts.compilerPlugins?.forEach((plugin) => { - const pluginResult = plugin.onAddHmr?.({ - programPath, - callExpressionPath: path, - insertionPath, - routeOptions, - createRouteFn, - opts: opts as CompileCodeSplitReferenceRouteOptions, - }) - - if (pluginResult?.modified) { - modified = true - } - }) - - programPath.pushContainer( - 'body', - createRouteHmrStatement(stableRouteOptionKeys, { - hmrStyle: opts.hmrStyle ?? 'vite', - targetFramework: opts.targetFramework, - routeId: opts.hmrRouteId, - }), - ) - modified = true - hmrAdded = true - } - - if (t.isObjectExpression(routeOptions)) { - const insertionPath = path.getStatementParent() ?? path - - opts.compilerPlugins?.forEach((plugin) => { - const pluginResult = plugin.onRouteOptions?.({ - programPath, - callExpressionPath: path, - insertionPath, - routeOptions, - createRouteFn, - opts: opts as CompileCodeSplitReferenceRouteOptions, - }) - - if (pluginResult?.modified) { - modified = true - } - }) - - if (opts.deleteNodes && opts.deleteNodes.size > 0) { - routeOptions.properties = routeOptions.properties.filter( - (prop) => { - if (t.isObjectProperty(prop)) { - const key = getObjectPropertyKeyName(prop) - if (key && opts.deleteNodes!.has(key as any)) { - modified = true - return false - } - } - return true - }, - ) - } - if (!splittableCreateRouteFns.includes(createRouteFn)) { - opts.compilerPlugins?.forEach((plugin) => { - const pluginResult = plugin.onUnsplittableRoute?.({ - programPath, - callExpressionPath: path, - insertionPath, - routeOptions, - createRouteFn, - opts: opts as CompileCodeSplitReferenceRouteOptions, - }) - - if (pluginResult?.modified) { - modified = true - } - }) - - // we can't split this route but we still add HMR handling if enabled - addRouteHmr(insertionPath, routeOptions) - // exit traversal so this route is not split - return programPath.stop() - } - routeOptions.properties.forEach((prop) => { - if (t.isObjectProperty(prop)) { - const key = getObjectPropertyKeyName(prop) - - if (key) { - // If the user has not specified a split grouping for this key - // then we should not split it - const codeSplitGroupingByKey = findIndexForSplitNode(key) - if (codeSplitGroupingByKey === -1) { - return - } - const codeSplitGroup = [ - ...new Set( - opts.codeSplitGroupings[codeSplitGroupingByKey], - ), - ] - - // find key in nodeSplitConfig - const isNodeConfigAvailable = SPLIT_NODES_CONFIG.has( - key as any, - ) - - if (!isNodeConfigAvailable) { - return - } - - // Exit early if the value is a boolean, null, or undefined. - // These values mean "don't use this component, fallback to parent" - // No code splitting needed to preserve fallback behavior - if ( - t.isBooleanLiteral(prop.value) || - t.isNullLiteral(prop.value) || - (t.isIdentifier(prop.value) && - prop.value.name === 'undefined') - ) { - return - } - - const splitNodeMeta = SPLIT_NODES_CONFIG.get(key as any)! - - // We need to extract the existing search params from the filename, if any - // and add the relevant codesplitPrefix to them, then write them back to the filename - const splitUrl = addSplitSearchParamToFilename( - opts.filename, - codeSplitGroup, - ) - - if ( - splitNodeMeta.splitStrategy === 'lazyRouteComponent' - ) { - const value = prop.value - - let shouldSplit = true - - if (t.isIdentifier(value)) { - const existingImportPath = - getImportSpecifierAndPathFromLocalName( - programPath, - value.name, - ).path - if (existingImportPath) { - removableImportPaths.add(existingImportPath) - } - - // exported identifiers should not be split - // since they are already being imported - // and need to be retained in the compiled file - const isExported = hasExport(ast, value) - if (isExported) { - knownExportedIdents.add(value.name) - } - shouldSplit = !isExported - - if (shouldSplit) { - removeIdentifierLiteral(path, value) - } - } - - if (!shouldSplit) { - return - } - - modified = true - - // Prepend the import statement to the program along with the importer function - // Check to see if lazyRouteComponent is already imported before attempting - // to import it again - if ( - !hasImportedOrDefinedIdentifier( - LAZY_ROUTE_COMPONENT_IDENT, - ) - ) { - programPath.unshiftContainer('body', [ - template.statement( - `import { ${LAZY_ROUTE_COMPONENT_IDENT} } from '${PACKAGE}'`, - )(), - ]) - } - - // Check to see if the importer function is already defined - // If not, define it with the dynamic import statement - if ( - !hasImportedOrDefinedIdentifier( - splitNodeMeta.localImporterIdent, - ) - ) { - programPath.unshiftContainer('body', [ - template.statement( - `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl}')`, - )(), - ]) - } - - const insertionPath = path.getStatementParent() ?? path - let splitPropValue: t.Expression | undefined - - for (const plugin of opts.compilerPlugins ?? []) { - const pluginPropValue = plugin.onSplitRouteProperty?.( - { - programPath, - callExpressionPath: path, - insertionPath, - routeOptions, - prop, - splitNodeMeta, - lazyRouteComponentIdent: - LAZY_ROUTE_COMPONENT_IDENT, - opts, - }, - ) - - if (!pluginPropValue) { - continue - } - - modified = true - splitPropValue = pluginPropValue - break - } - - if (splitPropValue) { - prop.value = splitPropValue - } else { - prop.value = template.expression( - `${LAZY_ROUTE_COMPONENT_IDENT}(${splitNodeMeta.localImporterIdent}, '${splitNodeMeta.exporterIdent}')`, - )() - } - - // add HMR handling - addRouteHmr(insertionPath, routeOptions) - } else { - // if (splitNodeMeta.splitStrategy === 'lazyFn') { - const value = prop.value - - let shouldSplit = true - - if (t.isIdentifier(value)) { - const existingImportPath = - getImportSpecifierAndPathFromLocalName( - programPath, - value.name, - ).path - if (existingImportPath) { - removableImportPaths.add(existingImportPath) - } - - // exported identifiers should not be split - // since they are already being imported - // and need to be retained in the compiled file - const isExported = hasExport(ast, value) - if (isExported) { - knownExportedIdents.add(value.name) - } - shouldSplit = !isExported - - if (shouldSplit) { - removeIdentifierLiteral(path, value) - } - } - - if (!shouldSplit) { - return - } - modified = true - - // Prepend the import statement to the program along with the importer function - if (!hasImportedOrDefinedIdentifier(LAZY_FN_IDENT)) { - programPath.unshiftContainer( - 'body', - template.smart( - `import { ${LAZY_FN_IDENT} } from '${PACKAGE}'`, - )(), - ) - } - - // Check to see if the importer function is already defined - // If not, define it with the dynamic import statement - if ( - !hasImportedOrDefinedIdentifier( - splitNodeMeta.localImporterIdent, - ) - ) { - programPath.unshiftContainer('body', [ - template.statement( - `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl}')`, - )(), - ]) - } - - // Add the lazyFn call with the dynamic import to the prop value - prop.value = template.expression( - `${LAZY_FN_IDENT}(${splitNodeMeta.localImporterIdent}, '${splitNodeMeta.exporterIdent}')`, - )() - } - } - } - - programPath.scope.crawl() - }) - - addRouteHmr(insertionPath, routeOptions) - } - } - - if (t.isCallExpression(path.parentPath.node)) { - // createFileRoute('/')({ ... }) - const options = resolveIdentifier( - path, - path.parentPath.node.arguments[0], - ) - - babelHandleReference(options) - } else if (t.isVariableDeclarator(path.parentPath.node)) { - // createFileRoute({ ... }) - const caller = resolveIdentifier(path, path.parentPath.node.init) - - if (t.isCallExpression(caller)) { - const options = resolveIdentifier(path, caller.arguments[0]) - babelHandleReference(options) - } - } - }, - }) - - /** - * If the component for the route is being imported, - * and it's not being used, remove the import statement - * from the program, by checking that the import has no - * specifiers - */ - if (removableImportPaths.size > 0) { - modified = true - programPath.traverse({ - ImportDeclaration(path) { - if (path.node.specifiers.length > 0) return - if (removableImportPaths.has(path.node.source.value)) { - path.remove() - } - }, - }) +) { + const analysis = sourceAnalysis(options) + const output = createOutput(analysis) + const { program, originalNodes, copies, renameBinding } = output + const framework = getFrameworkOptions(options.targetFramework) + const lazyImports = new Map() + const knownExported = new Set() + let modified = false + let hmrAdded = false + for (const route of analysis.routes) { + const routeOptions = copies.get(route.options) as ObjectExpression + const insertionStatement = copies.get(route.statement) as ProgramStatement + const context: ReferenceRouteCompilerPluginContext = { + program, + module: analysis.module, + originalNodes, + renameBinding, + routeOptions, + createRouteFn: route.factory, + opts: options, + insertBefore(nodes) { + program.body.splice( + program.body.indexOf(insertionStatement), + 0, + ...nodes, + ) + }, + } + for (const plugin of options.compilerPlugins ?? []) { + modified = !!plugin.onRouteOptions?.(context)?.modified || modified + } + if (options.deleteNodes?.size) { + routeOptions.properties = routeOptions.properties.filter((property) => { + const remove = + is.Property(property) && + options.deleteNodes!.has(getObjectPropertyKeyName(property) ?? '') + modified ||= remove + return !remove + }) + } + if (route.factory === 'createFileRoute') { + for (const prop of routeOptions.properties) { + if (!is.Property(prop) || !isDataProperty(prop)) { + continue } - - // Handle shared bindings inside the Program visitor so we have - // access to programPath for cheap refIdents registration. - if (opts.sharedBindings && opts.sharedBindings.size > 0) { - sharedExportedNames = findExportedSharedBindings( - ast, - opts.sharedBindings, - ) - removeSharedDeclarations(ast, opts.sharedBindings) - - const sharedModuleUrl = addSharedSearchParamToFilename(opts.filename) - - const sharedImportSpecifiers = [...opts.sharedBindings].map((name) => - t.importSpecifier(t.identifier(name), t.identifier(name)), - ) - const [sharedImportPath] = programPath.unshiftContainer( - 'body', - t.importDeclaration( - sharedImportSpecifiers, - t.stringLiteral(sharedModuleUrl), + const key = getObjectPropertyKeyName(prop) as SplitRouteIdentNodes + const group = options.codeSplitGroupings.find((keys) => + keys.includes(key), + ) + if (!group || !splitKeys.includes(key) || isFallback(prop.value)) { + continue + } + const original = originalNodes.get(unwrapExpression(prop.value)) + const symbol = + original && is.Identifier(original) + ? analysis.module.symbolOf(original) + : null + if (symbol && analysis.exported.has(symbol)) { + knownExported.add(symbol.name) + continue + } + const meta = splitMeta(key) + let lazy = lazyImports.get(meta.splitStrategy) + if (!lazy) { + lazy = getUniqueProgramIdentifier(program, meta.splitStrategy).name + prepend( + program, + imports( + [{ local: lazy, imported: meta.splitStrategy }], + framework.package, ), ) - - // Register import specifier locals in refIdents so DCE can remove unused ones - sharedImportPath.traverse({ - Identifier(identPath) { - if ( - identPath.parentPath.isImportSpecifier() && - identPath.key === 'local' - ) { - refIdents.add(identPath) - } - }, - }) - - // Re-export user-exported shared bindings from the shared module - if (sharedExportedNames.size > 0) { - const reExportSpecifiers = [...sharedExportedNames].map((name) => - t.exportSpecifier(t.identifier(name), t.identifier(name)), - ) - programPath.pushContainer( - 'body', - t.exportNamedDeclaration( - null, - reExportSpecifiers, - t.stringLiteral(sharedModuleUrl), - ), - ) + lazyImports.set(meta.splitStrategy, lazy) + } + meta.localImporterIdent = getUniqueProgramIdentifier( + program, + meta.localImporterIdent, + ).name + prepend( + program, + variable( + meta.localImporterIdent, + b.ArrowFunctionExpression({ + id: null, + generator: false, + async: false, + expression: true, + params: [], + body: b.ImportExpression({ + source: string(splitFilename(options.filename, group)), + options: null, + phase: null, + }), + }), + ), + ) + let value: Expression | undefined = undefined + for (const plugin of options.compilerPlugins ?? []) { + value = + plugin.onSplitRouteProperty?.({ + ...context, + prop, + splitNodeMeta: meta, + lazyRouteComponentIdent: lazy, + }) ?? undefined + if (value) { + break } } - }, - }, - }) - + prop.value = + value ?? + call(lazy, [ + reference(meta.localImporterIdent), + string(meta.exporterIdent), + ]) + prop.shorthand = false + modified = true + } + } else { + for (const plugin of options.compilerPlugins ?? []) { + modified = !!plugin.onUnsplittableRoute?.(context)?.modified || modified + } + } + if (options.addHmr && !hmrAdded) { + for (const plugin of options.compilerPlugins ?? []) { + plugin.onAddHmr?.(context) + } + const stableKeys = [ + ...new Set( + (options.compilerPlugins ?? []).flatMap( + (plugin) => plugin.getStableRouteOptionKeys?.() ?? [], + ), + ), + ] + program.body.push( + ...createRouteHmrStatement(stableKeys, { + hmrStyle: options.hmrStyle ?? 'vite', + targetFramework: options.targetFramework, + routeId: options.hmrRouteId, + }), + ) + modified = true + hmrAdded = true + } + } if (!modified) { return null } - - deadCodeElimination(ast, refIdents) - - // if there are exported identifiers, then we need to add a warning - // to the file to let the user know that the exported identifiers - // will not in the split file but in the original file, therefore - // increasing the bundle size - if (knownExportedIdents.size > 0) { - const warningMessage = createNotExportableMessage( - opts.filename, - knownExportedIdents, + if (options.sharedBindings?.size) { + program.body = program.body.filter((statement) => { + if ( + is.ExportNamedDeclaration(statement) && + !statement.source && + !statement.declaration + ) { + statement.specifiers = statement.specifiers.filter( + (specifier) => + !is.Identifier(specifier.local) || + !options.sharedBindings!.has(specifier.local.name), + ) + return statement.specifiers.length > 0 + } + return !( + is.ExportDefaultDeclaration(statement) && + is.Identifier(statement.declaration) && + options.sharedBindings!.has(statement.declaration.name) + ) + }) + } + addSharedImports(program, options.sharedBindings, options.filename) + const sharedExports = [...analysis.exported] + .filter(([symbol]) => options.sharedBindings?.has(symbol.name)) + .flatMap(([symbol, names]) => + names.map((name) => ({ local: symbol.name, exported: name })), ) - console.warn(warningMessage) - - // append this warning to the file using a template + if (sharedExports.length) { + program.body.push( + exports(sharedExports, addSharedSearchParamToFilename(options.filename)), + ) + } + removeUnusedBindings(analysis.module, program, originalNodes) + if (knownExported.size) { + const message = createNotExportableMessage(options.filename, knownExported) + console.warn(message) if (process.env.NODE_ENV !== 'production') { - const warningTemplate = template.statement( - `console.warn(${JSON.stringify(warningMessage)})`, - )() - ast.program.body.unshift(warningTemplate) + prepend( + program, + ...parseStatements(`console.warn(${JSON.stringify(message)})`), + ) } } - - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: opts.filename, - filename: opts.filename, + return generateModule(program, { + source: options.code, + filename: options.filename, }) - - // @babel/generator does not populate sourcesContent because it only has - // the AST, not the original text. Without this, Vite's composed - // sourcemap omits the original source, causing downstream consumers - // (e.g. import-protection snippet display) to fall back to the shorter - // compiled output and fail to resolve original line numbers. - if (result.map) { - result.map.sourcesContent = [opts.code] - } - - return result } export function compileCodeSplitVirtualRoute( - opts: ParseAstOptions & { + options: SourceOptions & { splitTargets: Array filename: string sharedBindings?: Set compilerPlugins?: Array }, -): GeneratorResult { - const ast = parseAst(opts) - const refIdents = findReferencedIdentifiers(ast) - - // Remove shared declarations BEFORE babel.traverse so the scope never sees - // conflicting bindings (avoids checkBlockScopedCollisions crash in DCE) - if (opts.sharedBindings && opts.sharedBindings.size > 0) { - removeSharedDeclarations(ast, opts.sharedBindings) +) { + const analysis = sourceAnalysis(options) + const { program, originalNodes, copies, renameBinding } = + createOutput(analysis) + if (!analysis.routes.some((route) => route.factory === 'createFileRoute')) { + return generateModule(program, { + source: options.code, + filename: options.filename, + }) } - - const intendedSplitNodes = new Set(opts.splitTargets) - - const knownExportedIdents = new Set() - - babel.traverse(ast, { - Program: { - enter(programPath) { - const trackedNodesToSplitByType: Record< - SplitRouteIdentNodes, - { node: t.Node | undefined; meta: SplitNodeMeta } | undefined - > = { - component: undefined, - loader: undefined, - pendingComponent: undefined, - errorComponent: undefined, - notFoundComponent: undefined, - } - - // Find and track all the known split-able nodes - programPath.traverse({ - CallExpression: (path) => { - if (!t.isIdentifier(path.node.callee)) { - return - } - - if (!splittableCreateRouteFns.includes(path.node.callee.name)) { - return - } - - function babelHandleVirtual(options: t.Node | undefined) { - if (t.isObjectExpression(options)) { - options.properties.forEach((prop) => { - if (t.isObjectProperty(prop)) { - // do not use `intendedSplitNodes` here - // since we have special considerations that need - // to be accounted for like (not splitting exported identifiers) - KNOWN_SPLIT_ROUTE_IDENTS.forEach((splitType) => { - if (getObjectPropertyKeyName(prop) !== splitType) { - return - } - - const value = prop.value - - // If the value for the `key` is `undefined`, then we don't need to include it - // in the split file, so we can just return, since it will kept in-place in the - // reference file - // This is useful for cases like: `createFileRoute('/')({ component: undefined })` - if (t.isIdentifier(value) && value.name === 'undefined') { - return - } - - let isExported = false - if (t.isIdentifier(value)) { - isExported = hasExport(ast, value) - if (isExported) { - knownExportedIdents.add(value.name) - } - } - - // If the node is exported, we need to remove - // the export from the split file - if (isExported && t.isIdentifier(value)) { - removeExports(ast, value) - } else { - const meta = SPLIT_NODES_CONFIG.get(splitType)! - trackedNodesToSplitByType[splitType] = { - node: prop.value, - meta, - } - } - }) - } - }) - - // Remove all of the options - options.properties = [] - } - } - - if (t.isCallExpression(path.parentPath.node)) { - // createFileRoute('/')({ ... }) - const options = resolveIdentifier( - path, - path.parentPath.node.arguments[0], - ) - - babelHandleVirtual(options) - } else if (t.isVariableDeclarator(path.parentPath.node)) { - // createFileRoute({ ... }) - const caller = resolveIdentifier(path, path.parentPath.node.init) - - if (t.isCallExpression(caller)) { - const options = resolveIdentifier(path, caller.arguments[0]) - babelHandleVirtual(options) - } - } - }, - }) - - // Start the transformation to only exported the intended split nodes - intendedSplitNodes.forEach((SPLIT_TYPE) => { - const splitKey = trackedNodesToSplitByType[SPLIT_TYPE] - - if (!splitKey) { - return - } - - let splitNode = splitKey.node - const splitMeta = { ...splitKey.meta, shouldRemoveNode: true } - - // Track the original identifier name before resolving through bindings, - // needed for destructured patterns where the binding resolves to the - // entire VariableDeclarator (ObjectPattern) rather than the specific binding - let originalIdentName: string | undefined - if (t.isIdentifier(splitNode)) { - originalIdentName = splitNode.name - } - - while (t.isIdentifier(splitNode)) { - const binding = programPath.scope.getBinding(splitNode.name) - splitNode = binding?.path.node - } - - // Add the node to the program - if (splitNode) { - for (const plugin of opts.compilerPlugins ?? []) { - plugin.onVirtualRouteSplitNode?.({ - programPath, - splitNode, - splitNodeMeta: splitMeta, - }) - } - - if (t.isFunctionDeclaration(splitNode)) { - // an anonymous function declaration should only happen for `export default function() {...}` - // so we should never get here - if (!splitNode.id) { - throw new Error( - `Function declaration for "${SPLIT_TYPE}" must have an identifier.`, - ) - } - - splitMeta.shouldRemoveNode = false - splitMeta.localExporterIdent = splitNode.id.name - } else if ( - t.isFunctionExpression(splitNode) || - t.isArrowFunctionExpression(splitNode) - ) { - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - splitNode, - ), - ]), - ) - } else if ( - t.isImportSpecifier(splitNode) || - t.isImportDefaultSpecifier(splitNode) - ) { - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - splitNode.local, - ), - ]), - ) - } else if (t.isVariableDeclarator(splitNode)) { - if (t.isIdentifier(splitNode.id)) { - splitMeta.localExporterIdent = splitNode.id.name - splitMeta.shouldRemoveNode = false - } else if (t.isObjectPattern(splitNode.id)) { - // Destructured binding like `const { component: MyComp } = createBits()` - // Use the original identifier name that was tracked before resolving - if (originalIdentName) { - splitMeta.localExporterIdent = originalIdentName - } - splitMeta.shouldRemoveNode = false - } else { - throw new Error( - `Unexpected splitNode type ☝️: ${splitNode.type}`, - ) - } - } else if (t.isCallExpression(splitNode)) { - const outputSplitNodeCode = generateFromAst(splitNode).code - const splitNodeAst = babel.parse(outputSplitNodeCode) - - if (!splitNodeAst) { - throw new Error( - `Failed to parse the generated code for "${SPLIT_TYPE}" in the node type "${splitNode.type}"`, - ) - } - - const statement = splitNodeAst.program.body[0] - - if (!statement) { - throw new Error( - `Failed to parse the generated code for "${SPLIT_TYPE}" in the node type "${splitNode.type}" as no statement was found in the program body`, - ) - } - - if (t.isExpressionStatement(statement)) { - const expression = statement.expression - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - expression, - ), - ]), - ) - } else { - throw new Error( - `Unexpected expression type encounter for "${SPLIT_TYPE}" in the node type "${splitNode.type}"`, - ) - } - } else if (t.isConditionalExpression(splitNode)) { - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - splitNode, - ), - ]), - ) - } else if (t.isTSAsExpression(splitNode)) { - // remove the type assertion - splitNode = splitNode.expression - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - splitNode, - ), - ]), - ) - } else if (t.isBooleanLiteral(splitNode)) { - // Handle boolean literals - // This exits early here, since this value will be kept in the reference file - return - } else if (t.isNullLiteral(splitNode)) { - // Handle null literals - // This exits early here, since this value will be kept in the reference file - return - } else { - console.info('Unexpected splitNode type:', splitNode) - throw new Error(`Unexpected splitNode type ☝️: ${splitNode.type}`) - } - } - - if (splitMeta.shouldRemoveNode) { - // If the splitNode exists at the top of the program - // then we need to remove that copy - programPath.node.body = programPath.node.body.filter((node) => { - return node !== splitNode + const generatedExports: Array = [] + for (const route of analysis.routes) { + if (route.factory !== 'createFileRoute') { + continue + } + for (const property of properties(route)) { + if (!isDataProperty(property)) { + continue + } + const key = getObjectPropertyKeyName(property) as SplitRouteIdentNodes + if (!options.splitTargets.includes(key) || isFallback(property.value)) { + continue + } + const propertyValue = unwrapExpression(property.value) + const symbol = is.Identifier(propertyValue) + ? analysis.module.symbolOf(propertyValue) + : null + if (symbol && analysis.exported.has(symbol)) { + continue + } + const value = copies.get(propertyValue) as Expression + const meta = splitMeta(key) + if (is.Identifier(value)) { + const declaration = symbol + ? analysis.graph.declarations.get(symbol) + : undefined + const splitNode = declaration ? copies.get(declaration) : undefined + if (splitNode) { + for (const plugin of options.compilerPlugins ?? []) { + plugin.onVirtualRouteSplitNode?.({ + program, + renameBinding, + splitNode, + splitNodeMeta: meta, }) } - - // Export the node - programPath.pushContainer('body', [ - t.exportNamedDeclaration(null, [ - t.exportSpecifier( - t.identifier(splitMeta.localExporterIdent), // local variable name - t.identifier(splitMeta.exporterIdent), // as what name it should be exported as - ), - ]), - ]) - }) - - // convert exports to imports from the original file - programPath.traverse({ - ExportNamedDeclaration(path) { - // e.g. export const x = 1 or export { x } - // becomes - // import { x } from '${opts.id}' - - if (path.node.declaration) { - if (t.isVariableDeclaration(path.node.declaration)) { - const specifiers = path.node.declaration.declarations.flatMap( - (decl) => { - if (t.isIdentifier(decl.id)) { - return [ - t.importSpecifier( - t.identifier(decl.id.name), - t.identifier(decl.id.name), - ), - ] - } - - if (t.isObjectPattern(decl.id)) { - return collectIdentifiersFromPattern(decl.id).map( - (name) => - t.importSpecifier( - t.identifier(name), - t.identifier(name), - ), - ) - } - - if (t.isArrayPattern(decl.id)) { - return collectIdentifiersFromPattern(decl.id).map( - (name) => - t.importSpecifier( - t.identifier(name), - t.identifier(name), - ), - ) - } - - return [] - }, - ) - - if (specifiers.length === 0) { - path.remove() - return - } - - const importDecl = t.importDeclaration( - specifiers, - t.stringLiteral( - removeSplitSearchParamFromFilename(opts.filename), - ), - ) - - path.replaceWith(importDecl) - - // Track the imported identifier paths so deadCodeElimination can remove them if unused - // We need to traverse the newly created import to get the identifier paths - path.traverse({ - Identifier(identPath) { - // Only track the local binding identifiers (the imported names) - if ( - identPath.parentPath.isImportSpecifier() && - identPath.key === 'local' - ) { - refIdents.add(identPath) - } - }, - }) - } - } - }, - }) - - // Add shared bindings import, registering specifiers in refIdents - // so DCE can remove unused ones (same pattern as import replacements above). - if (opts.sharedBindings && opts.sharedBindings.size > 0) { - const sharedImportSpecifiers = [...opts.sharedBindings].map((name) => - t.importSpecifier(t.identifier(name), t.identifier(name)), - ) - const sharedModuleUrl = addSharedSearchParamToFilename( - removeSplitSearchParamFromFilename(opts.filename), - ) - const [sharedImportPath] = programPath.unshiftContainer( - 'body', - t.importDeclaration( - sharedImportSpecifiers, - t.stringLiteral(sharedModuleUrl), - ), - ) - - sharedImportPath.traverse({ - Identifier(identPath) { - if ( - identPath.parentPath.isImportSpecifier() && - identPath.key === 'local' - ) { - refIdents.add(identPath) - } - }, - }) } - }, - }, - }) - - deadCodeElimination(ast, refIdents) - stripUnreferencedTopLevelExpressionStatements(ast) - - // If the body is empty after DCE, strip directive prologues too. - // A file containing only `'use client'` with no real code is useless. - if (ast.program.body.length === 0) { - ast.program.directives = [] - } - - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: opts.filename, - filename: opts.filename, - }) - - // @babel/generator does not populate sourcesContent — see compileCodeSplitReferenceRoute. - if (result.map) { - result.map.sourcesContent = [opts.code] - } - - return result -} - -/** - * Compile the shared virtual module (`?tsr-shared=1`). - * Keeps only shared binding declarations, their transitive dependencies, - * and imports they need. Exports all shared bindings. - */ -export function compileCodeSplitSharedRoute( - opts: ParseAstOptions & { - sharedBindings: Set - filename: string - }, -): GeneratorResult { - const ast = parseAst(opts) - const refIdents = findReferencedIdentifiers(ast) - - // Collect all names that need to stay: shared bindings + their transitive deps - const localBindings = new Set() - for (const node of ast.program.body) { - collectLocalBindingsFromStatement(node, localBindings) + generatedExports.push( + exports([ + { local: value.name, exported: key, symbol: symbol ?? undefined }, + ]), + ) + } else { + const name = getUniqueProgramIdentifier( + program, + meta.localExporterIdent, + ).name + generatedExports.push( + variable(name, value), + exports([{ local: name, exported: key }]), + ) + } + } + ;(copies.get(route.options) as ObjectExpression).properties = [] } - - // Route must never be extracted into the shared module. - // Excluding it from the dep graph prevents expandTransitively from - // pulling it in as a transitive dependency of a shared binding. - localBindings.delete('Route') - - const declMap = buildDeclarationMap(ast) - const depGraph = buildDependencyGraph(declMap, localBindings) - - // Start with shared bindings and expand transitively - const keepBindings = new Set(opts.sharedBindings) - keepBindings.delete('Route') - expandTransitively(keepBindings, depGraph) - - retainModuleLevelDeclarations(ast, keepBindings) - unwrapExportedDeclarations(ast) - - // Export all shared bindings (sorted for deterministic output) - const exportNames = [...opts.sharedBindings].sort((a, b) => - a.localeCompare(b), + // A split module imports user exports, including the Route singleton, from the + // reference module instead of initializing a second copy. + const userExports = new Set( + [...analysis.exported.keys()].map((symbol) => symbol.name), ) - const exportSpecifiers = exportNames.map((name) => - t.exportSpecifier(t.identifier(name), t.identifier(name)), + program.body = program.body.flatMap((statement): Array => { + if (is.ExportNamedDeclaration(statement)) { + return statement.declaration ? [statement.declaration] : [] + } + if (is.ExportDefaultDeclaration(statement)) { + return is.FunctionDeclaration(statement.declaration) || + is.ClassDeclaration(statement.declaration) + ? [statement.declaration] + : [] + } + if (is.ExportAllDeclaration(statement)) { + return [] + } + return [statement] + }) + removeDeclarations(program, userExports) + const retainedExports = [...analysis.exported].filter( + ([symbol]) => !options.sharedBindings?.has(symbol.name), ) - if (exportSpecifiers.length > 0) { - const exportDecl = t.exportNamedDeclaration(null, exportSpecifiers) - ast.program.body.push(exportDecl) - - // Register export specifier locals in refIdents so DCE doesn't treat - // the exported bindings as unreferenced. - babel.traverse(ast, { - Program(programPath) { - const bodyPaths = programPath.get('body') - const last = bodyPaths[bodyPaths.length - 1] - if (last && last.isExportNamedDeclaration()) { - last.traverse({ - Identifier(identPath) { - if ( - identPath.parentPath.isExportSpecifier() && - identPath.key === 'local' - ) { - refIdents.add(identPath) - } - }, - }) - } - programPath.stop() - }, - }) - } - - deadCodeElimination(ast, refIdents) - - // If the body is empty after DCE, strip directive prologues too. - if (ast.program.body.length === 0) { - ast.program.directives = [] + if (retainedExports.length) { + prepend( + program, + imports( + retainedExports.map(([symbol, names]) => ({ + local: symbol.name, + imported: names[0]!, + })), + bareFilename(options.filename), + ), + ) } - - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: opts.filename, - filename: opts.filename, + addSharedImports(program, options.sharedBindings, options.filename) + program.body.push(...generatedExports) + removeUnusedBindings(analysis.module, program, originalNodes) + stripUnownedExpressions(analysis.module, program, originalNodes) + return generateModule(program, { + source: options.code, + filename: options.filename, }) - - // @babel/generator does not populate sourcesContent — see compileCodeSplitReferenceRoute. - if (result.map) { - result.map.sourcesContent = [opts.code] - } - - return result } -/** - * This function should read get the options from by searching for the key `codeSplitGroupings` - * on createFileRoute and return it's values if it exists, else return undefined - */ -export function detectCodeSplitGroupingsFromRoute(opts: ParseAstOptions): { - groupings: CodeSplitGroupings | undefined -} { - const ast = parseAst(opts) - - let codeSplitGroupings: CodeSplitGroupings | undefined = undefined - - babel.traverse(ast, { - Program: { - enter(programPath) { - programPath.traverse({ - CallExpression(path) { - if (!t.isIdentifier(path.node.callee)) { - return - } - - if ( - !( - path.node.callee.name === 'createRoute' || - path.node.callee.name === 'createFileRoute' - ) - ) { - return - } - - function babelHandleSplittingGroups( - routeOptions: t.Node | undefined, - ) { - if (t.isObjectExpression(routeOptions)) { - routeOptions.properties.forEach((prop) => { - if (t.isObjectProperty(prop)) { - const key = getObjectPropertyKeyName(prop) - if (key === 'codeSplitGroupings') { - const value = prop.value - - if (t.isArrayExpression(value)) { - codeSplitGroupings = value.elements.map((group) => { - if (t.isArrayExpression(group)) { - return group.elements.map((node) => { - if (!t.isStringLiteral(node)) { - throw new Error( - 'You must provide a string literal for the codeSplitGroupings', - ) - } - - return node.value - }) as Array - } - - throw new Error( - 'You must provide arrays with codeSplitGroupings options.', - ) - }) - } else { - throw new Error( - 'You must provide an array of arrays for the codeSplitGroupings.', - ) - } - } - } - }) - } - } - - // Extracting the codeSplitGroupings - if (t.isCallExpression(path.parentPath.node)) { - // createFileRoute('/')({ ... }) - const options = resolveIdentifier( - path, - path.parentPath.node.arguments[0], - ) - - babelHandleSplittingGroups(options) - } else if (t.isVariableDeclarator(path.parentPath.node)) { - // createFileRoute({ ... }) - const caller = resolveIdentifier(path, path.parentPath.node.init) - - if (t.isCallExpression(caller)) { - const options = resolveIdentifier(path, caller.arguments[0]) - babelHandleSplittingGroups(options) - } - } - }, - }) - }, - }, - }) - - return { groupings: codeSplitGroupings } -} - -function createNotExportableMessage( - filename: string, - idents: Set, -): string { - const list = Array.from(idents).map((d) => `- ${d}`) - - const message = [ - `[tanstack-router] These exports from "${filename}" will not be code-split and will increase your bundle size:`, - ...list, - 'For the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file.', - ].join('\n') - - return message -} - -function getImportSpecifierAndPathFromLocalName( - programPath: babel.NodePath, - name: string, -): { - specifier: - | t.ImportSpecifier - | t.ImportDefaultSpecifier - | t.ImportNamespaceSpecifier - | null - path: string | null -} { - let specifier: - | t.ImportSpecifier - | t.ImportDefaultSpecifier - | t.ImportNamespaceSpecifier - | null = null - let path: string | null = null - - programPath.traverse({ - ImportDeclaration(importPath) { - const found = importPath.node.specifiers.find( - (targetSpecifier) => targetSpecifier.local.name === name, - ) - if (found) { - specifier = found - path = importPath.node.source.value +function stripUnownedExpressions( + module: Module, + program: Program, + originalNodes: WeakMap, +) { + const localNames = new Set() + for (const statement of program.body) { + if (is.VariableDeclaration(statement)) { + for (const declaration of statement.declarations) { + for (const id of bindingIdentifiers(declaration.id)) { + localNames.add(id.name) + } } - }, + } else if ( + (is.FunctionDeclaration(statement) || is.ClassDeclaration(statement)) && + statement.id + ) { + localNames.add(statement.id.name) + } + } + program.body = program.body.filter((statement) => { + if (is.Directive(statement) || !is.ExpressionStatement(statement)) { + return true + } + const original = originalNodes.get(statement) + return ( + !!original && + [...collectModuleReferences(module, original)].some((symbol) => + localNames.has(symbol.name), + ) + ) }) - - return { specifier, path } + if (program.body.every((statement) => is.Directive(statement))) { + program.body = [] + } } -// Reusable function to get literal value or resolve variable to literal -function resolveIdentifier(path: any, node: any): t.Node | undefined { - if (t.isIdentifier(node)) { - const binding = path.scope.getBinding(node.name) +export function compileCodeSplitSharedRoute( + options: SourceOptions & { sharedBindings: Set; filename: string }, +) { + const analysis = sourceAnalysis(options) + const { program, originalNodes } = createOutput(analysis) + const keep = expandTransitively( + new Set( + analysis.module.rootScope.bindings.filter( + (symbol) => + symbol.name !== 'Route' && options.sharedBindings.has(symbol.name), + ), + ), + analysis.graph.dependencies, + ) + const names = new Set([...keep].map((symbol) => symbol.name)) + const remove = new Set( + analysis.module.rootScope.bindings + .filter((symbol) => !names.has(symbol.name)) + .map((symbol) => symbol.name), + ) + program.body = program.body.flatMap((statement): Array => { + if (is.ExportNamedDeclaration(statement)) { + return statement.declaration ? [statement.declaration] : [] + } + if (is.ExportDefaultDeclaration(statement)) { + return is.FunctionDeclaration(statement.declaration) || + is.ClassDeclaration(statement.declaration) + ? [statement.declaration] + : [] + } + if (is.ExportAllDeclaration(statement)) { + return [] + } if ( - binding - // && binding.kind === 'const' + !is.Declaration(statement) && + !is.ImportDeclaration(statement) && + !is.Directive(statement) ) { - const declarator = binding.path.node - if (t.isObjectExpression(declarator.init)) { - return declarator.init - } else if (t.isFunctionDeclaration(declarator.init)) { - return declarator.init - } + return [] } - return undefined - } - - return node + return [statement] + }) + removeDeclarations(program, remove) + program.body.push( + exports( + [...options.sharedBindings] + .sort() + .map((name) => ({ local: name, exported: name })), + ), + ) + removeUnusedBindings(analysis.module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + return generateModule(program, { + source: options.code, + filename: options.filename, + }) } -function removeIdentifierLiteral(path: babel.NodePath, node: t.Identifier) { - const binding = path.scope.getBinding(node.name) - if (binding) { - // If the binding is a destructured property from an ObjectPattern, - // only remove that property instead of the entire declaration +export function detectCodeSplitGroupingsFromRoute(options: SourceOptions): { + groupings: CodeSplitGroupings | undefined +} { + const analysis = sourceAnalysis(options) + for (const route of analysis.routes) { if ( - t.isVariableDeclarator(binding.path.node) && - t.isObjectPattern(binding.path.node.id) + route.factory !== 'createFileRoute' && + route.factory !== 'createRoute' ) { - const objectPattern = binding.path.node.id - objectPattern.properties = objectPattern.properties.filter((prop) => { - if (!t.isObjectProperty(prop)) { - return true - } - - if (t.isIdentifier(prop.value) && prop.value.name === node.name) { - return false - } - - if ( - t.isAssignmentPattern(prop.value) && - t.isIdentifier(prop.value.left) && - prop.value.left.name === node.name - ) { - return false - } - - return true - }) - - // If no properties remain, remove the entire declaration - if (objectPattern.properties.length === 0) { - binding.path.remove() - } - - return + continue } - - binding.path.remove() - } -} - -function hasExport(ast: t.File, node: t.Identifier): boolean { - let found = false - - babel.traverse(ast, { - ExportNamedDeclaration(path) { - if (path.node.declaration) { - // declared as `const loaderFn = () => {}` - if (t.isVariableDeclaration(path.node.declaration)) { - path.node.declaration.declarations.forEach((decl) => { - if (t.isVariableDeclarator(decl)) { - if (t.isIdentifier(decl.id)) { - if (decl.id.name === node.name) { - found = true - } - } else if ( - t.isObjectPattern(decl.id) || - t.isArrayPattern(decl.id) - ) { - // Handle destructured exports like `export const { a, b } = fn()` - const names = collectIdentifiersFromPattern(decl.id) - if (names.includes(node.name)) { - found = true - } - } - } - }) - } - - // declared as `function loaderFn() {}` - if (t.isFunctionDeclaration(path.node.declaration)) { - if (t.isIdentifier(path.node.declaration.id)) { - if (path.node.declaration.id.name === node.name) { - found = true - } - } - } + for (const property of properties(route)) { + if (getObjectPropertyKeyName(property) !== 'codeSplitGroupings') { + continue } - }, - ExportDefaultDeclaration(path) { - // declared as `export default loaderFn` - if (t.isIdentifier(path.node.declaration)) { - if (path.node.declaration.name === node.name) { - found = true - } + const value = unwrapExpression(property.value) + if (!is.ArrayExpression(value)) { + throw new Error( + 'You must provide an array of arrays for the codeSplitGroupings.', + ) } - - // declared as `export default function loaderFn() {}` - if (t.isFunctionDeclaration(path.node.declaration)) { - if (t.isIdentifier(path.node.declaration.id)) { - if (path.node.declaration.id.name === node.name) { - found = true + return { + groupings: value.elements.map((element) => { + const group = is.Expression(element) + ? unwrapExpression(element) + : element + if (!is.ArrayExpression(group)) { + throw new Error( + 'You must provide arrays with codeSplitGroupings options.', + ) } - } - } - }, - }) - - return found -} - -function removeExports(ast: t.File, node: t.Identifier): boolean { - let removed = false - - // The checks use sequential if/else if statements since it - // directly mutates the AST and as such doing normal checks - // (using only if statements) could lead to a situation where - // `path.node` is null since it has been already removed from - // the program tree but typescript doesn't know that. - babel.traverse(ast, { - ExportNamedDeclaration(path) { - if (path.node.declaration) { - if (t.isVariableDeclaration(path.node.declaration)) { - // declared as `const loaderFn = () => {}` - path.node.declaration.declarations.forEach((decl) => { - if (t.isVariableDeclarator(decl)) { - if (t.isIdentifier(decl.id)) { - if (decl.id.name === node.name) { - path.remove() - removed = true - } - } else if ( - t.isObjectPattern(decl.id) || - t.isArrayPattern(decl.id) - ) { - // Handle destructured exports like `export const { a, b } = fn()` - const names = collectIdentifiersFromPattern(decl.id) - if (names.includes(node.name)) { - path.remove() - removed = true - } - } + return group.elements.map((element) => { + const item = is.Expression(element) + ? unwrapExpression(element) + : element + if (!is.Literal(item) || typeof item.value !== 'string') { + throw new Error( + 'You must provide a string literal for the codeSplitGroupings', + ) } + return item.value as SplitRouteIdentNodes }) - } else if (t.isFunctionDeclaration(path.node.declaration)) { - // declared as `export const loaderFn = () => {}` - if (t.isIdentifier(path.node.declaration.id)) { - if (path.node.declaration.id.name === node.name) { - path.remove() - removed = true - } - } - } + }), } - }, - ExportDefaultDeclaration(path) { - // declared as `export default loaderFn` - if (t.isIdentifier(path.node.declaration)) { - if (path.node.declaration.name === node.name) { - path.remove() - removed = true - } - } else if (t.isFunctionDeclaration(path.node.declaration)) { - // declared as `export default function loaderFn() {}` - if (t.isIdentifier(path.node.declaration.id)) { - if (path.node.declaration.id.name === node.name) { - path.remove() - removed = true - } - } - } - }, - }) + } + } + return { groupings: undefined } +} - return removed +function createNotExportableMessage( + filename: string, + identifiers: Set, +) { + return [ + `[tanstack-router] These exports from "${filename}" will not be code-split and will increase your bundle size:`, + ...[...identifiers].map((name) => `- ${name}`), + 'For the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file.', + ].join('\n') } diff --git a/packages/router-plugin/src/core/code-splitter/plugins.ts b/packages/router-plugin/src/core/code-splitter/plugins.ts index 1e8ada32b58..ce5a2a145ee 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins.ts @@ -1,5 +1,12 @@ -import type babel from '@babel/core' -import type * as t from '@babel/types' +import type { Module } from 'yuku-analyzer' +import type { + Expression, + Node, + ObjectExpression, + ObjectProperty, + Program, + ProgramStatement, +} from '@yuku-toolchain/types' import type { Config, DeletableNodes, HmrStyle } from '../config' import type { CodeSplitGroupings } from '../constants' import type { SplitNodeMeta } from './types' @@ -17,32 +24,32 @@ export type CompileCodeSplitReferenceRouteOptions = { } export type ReferenceRouteCompilerPluginContext = { - programPath: babel.NodePath - callExpressionPath: babel.NodePath - insertionPath: babel.NodePath - routeOptions: t.ObjectExpression + program: Program + module: Module + originalNodes: WeakMap + insertBefore: (nodes: Array) => void + renameBinding: (node: Node, name: string) => void + routeOptions: ObjectExpression createRouteFn: string opts: CompileCodeSplitReferenceRouteOptions } -export type ReferenceRouteSplitPropertyCompilerPluginContext = { - programPath: babel.NodePath - callExpressionPath: babel.NodePath - insertionPath: babel.NodePath - routeOptions: t.ObjectExpression - prop: t.ObjectProperty - splitNodeMeta: SplitNodeMeta - lazyRouteComponentIdent: string - opts: CompileCodeSplitReferenceRouteOptions -} +export type ReferenceRouteSplitPropertyCompilerPluginContext = + ReferenceRouteCompilerPluginContext & { + prop: ObjectProperty + splitNodeMeta: SplitNodeMeta + lazyRouteComponentIdent: string + opts: CompileCodeSplitReferenceRouteOptions + } export type ReferenceRouteCompilerPluginResult = { modified?: boolean } export type VirtualRouteSplitNodeCompilerPluginContext = { - programPath: babel.NodePath - splitNode: t.Node + program: Program + renameBinding: (node: Node, name: string) => void + splitNode: Node splitNodeMeta: SplitNodeMeta } @@ -60,7 +67,7 @@ export type CodeSplitCompilerPlugin = { ) => void | ReferenceRouteCompilerPluginResult onSplitRouteProperty?: ( ctx: ReferenceRouteSplitPropertyCompilerPluginContext, - ) => void | t.Expression + ) => void | Expression onVirtualRouteSplitNode?: ( ctx: VirtualRouteSplitNodeCompilerPluginContext, ) => void diff --git a/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-ignored-route-exports.ts b/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-ignored-route-exports.ts index cc2be62034f..e423a3ae2ec 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-ignored-route-exports.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-ignored-route-exports.ts @@ -1,10 +1,17 @@ -import * as template from '@babel/template' -import * as t from '@babel/types' +import { parseStatements } from '@tanstack/router-utils' import { getUniqueProgramIdentifier } from '../../utils' import type { ReferenceRouteCompilerPlugin } from '../plugins' -const buildReactRefreshIgnoredRouteExportsStatements = template.statements( - ` +export function createReactRefreshIgnoredRouteExportsPlugin(): ReferenceRouteCompilerPlugin { + return { + name: 'react-refresh-ignored-route-exports', + onAddHmr(ctx) { + const anchorName = getUniqueProgramIdentifier( + ctx.program, + 'TSRFastRefreshAnchor', + ) + ctx.program.body.push( + ...parseStatements(` const hot = import.meta.hot if (hot && typeof window !== 'undefined') { hot.data ??= {} @@ -23,44 +30,12 @@ if (hot && typeof window !== 'undefined') { } })() - tsrReactRefresh.ignoredExportsById.set(%%moduleId%%, ['Route']) + tsrReactRefresh.ignoredExportsById.set(${JSON.stringify(ctx.opts.id)}, ['Route']) } -`, - { syntacticPlaceholders: true }, -) - -/** - * A trivial component-shaped export that gives `@vitejs/plugin-react` a valid - * Fast Refresh boundary. Without at least one non-ignored component export, - * the module would be invalidated (full page reload) on every update even - * though our custom route HMR handler already manages the update. - */ -const buildRefreshAnchorStatement = template.statement( - `export function %%anchorName%%() { return null }`, - { syntacticPlaceholders: true }, -) -export function createReactRefreshIgnoredRouteExportsPlugin(): ReferenceRouteCompilerPlugin { - return { - name: 'react-refresh-ignored-route-exports', - onAddHmr(ctx) { - const anchorName = getUniqueProgramIdentifier( - ctx.programPath, - 'TSRFastRefreshAnchor', +export function ${anchorName.name}() { return null } +`), ) - - ctx.programPath.pushContainer( - 'body', - buildReactRefreshIgnoredRouteExportsStatements({ - moduleId: t.stringLiteral(ctx.opts.id), - }), - ) - - ctx.programPath.pushContainer( - 'body', - buildRefreshAnchorStatement({ anchorName }), - ) - return { modified: true } }, } diff --git a/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-route-components.ts b/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-route-components.ts index 44041671e0f..35830de6a78 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-route-components.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins/react-refresh-route-components.ts @@ -1,8 +1,13 @@ -import * as t from '@babel/types' +import { b } from 'yuku-ast' +import { + moduleDeclarationGraph, + unwrapExpression, +} from '@tanstack/router-utils' import { getObjectPropertyKeyName, getUniqueProgramIdentifier, } from '../../utils' +import type { ObjectProperty, VariableDeclaration } from '@yuku-toolchain/types' import type { ReferenceRouteCompilerPlugin } from '../plugins' const REACT_REFRESH_ROUTE_COMPONENT_IDENTS = new Set([ @@ -13,11 +18,9 @@ const REACT_REFRESH_ROUTE_COMPONENT_IDENTS = new Set([ 'notFoundComponent', ]) -type RouteComponentContext = { - programPath: Parameters[0] - insertionPath: { insertBefore: (nodes: Array) => void } - routeOptions: t.ObjectExpression -} +type RouteComponentContext = Parameters< + NonNullable +>[0] function isReactComponentName(name: string) { const firstCharacter = name[0] @@ -29,18 +32,18 @@ function isReactComponentName(name: string) { ) } -function getRouteComponentKey(prop: t.ObjectProperty) { +function getRouteComponentKey(prop: ObjectProperty) { const key = getObjectPropertyKeyName(prop) return key && REACT_REFRESH_ROUTE_COMPONENT_IDENTS.has(key) ? key : undefined } function prepareRouteComponentsForReactRefresh(ctx: RouteComponentContext) { - const hoistedDeclarations: Array = [] + const hoistedDeclarations: Array = [] let modified = false for (const prop of ctx.routeOptions.properties) { - if (!t.isObjectProperty(prop)) { + if (prop.type !== 'Property' || prop.method || prop.kind !== 'init') { continue } @@ -50,56 +53,67 @@ function prepareRouteComponentsForReactRefresh(ctx: RouteComponentContext) { continue } - if (t.isIdentifier(prop.value)) { + prop.value = unwrapExpression(prop.value) + + if (prop.value.type === 'Identifier') { if (isReactComponentName(prop.value.name)) { continue } - const bindingNode = ctx.programPath.scope.getBinding(prop.value.name) - ?.path.node + const original = ctx.originalNodes.get(prop.value) + const symbol = original ? ctx.module.symbolOf(original) : null + if (symbol && ctx.opts.sharedBindings?.has(symbol.name)) { + continue + } + const bindingNode = symbol + ? moduleDeclarationGraph(ctx.module).declarations.get(symbol) + : undefined const isLocalComponentBinding = - t.isFunctionDeclaration(bindingNode) || - t.isClassDeclaration(bindingNode) || - t.isVariableDeclarator(bindingNode) + bindingNode?.type === 'FunctionDeclaration' || + bindingNode?.type === 'ClassDeclaration' || + bindingNode?.type === 'VariableDeclarator' if (!isLocalComponentBinding) { continue } const componentIdentifier = getUniqueProgramIdentifier( - ctx.programPath, + ctx.program, `TSR${key[0]!.toUpperCase()}${key.slice(1)}`, ) - ctx.programPath.scope.rename(prop.value.name, componentIdentifier.name) + ctx.renameBinding(prop.value, componentIdentifier.name) modified = true continue } if ( - !t.isArrowFunctionExpression(prop.value) && - !t.isFunctionExpression(prop.value) + prop.value.type !== 'ArrowFunctionExpression' && + prop.value.type !== 'FunctionExpression' ) { continue } const hoistedIdentifier = getUniqueProgramIdentifier( - ctx.programPath, + ctx.program, `TSR${key[0]!.toUpperCase()}${key.slice(1)}`, ) hoistedDeclarations.push( - t.variableDeclaration('const', [ - t.variableDeclarator(hoistedIdentifier, t.cloneNode(prop.value, true)), - ]), + b.VariableDeclaration({ + kind: 'const', + declarations: [ + b.VariableDeclarator({ id: hoistedIdentifier, init: prop.value }), + ], + }), ) - prop.value = t.cloneNode(hoistedIdentifier) + prop.value = b.Identifier({ name: hoistedIdentifier.name }) modified = true } if (hoistedDeclarations.length > 0) { - ctx.insertionPath.insertBefore(hoistedDeclarations) + ctx.insertBefore(hoistedDeclarations) } return modified @@ -121,7 +135,7 @@ export function createReactRefreshRouteComponentsPlugin(): ReferenceRouteCompile onVirtualRouteSplitNode(ctx) { if ( ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent' || - !t.isFunctionDeclaration(ctx.splitNode) || + ctx.splitNode.type !== 'FunctionDeclaration' || !ctx.splitNode.id || isReactComponentName(ctx.splitNode.id.name) ) { @@ -129,14 +143,11 @@ export function createReactRefreshRouteComponentsPlugin(): ReferenceRouteCompile } const componentIdentifier = getUniqueProgramIdentifier( - ctx.programPath, + ctx.program, ctx.splitNodeMeta.localExporterIdent, ) - ctx.programPath.scope.rename( - ctx.splitNode.id.name, - componentIdentifier.name, - ) + ctx.renameBinding(ctx.splitNode.id, componentIdentifier.name) }, } } diff --git a/packages/router-plugin/src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts b/packages/router-plugin/src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts index 99448f452ad..d522aee451a 100644 --- a/packages/router-plugin/src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts +++ b/packages/router-plugin/src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts @@ -1,39 +1,9 @@ -import * as template from '@babel/template' -import * as t from '@babel/types' +import { b } from 'yuku-ast' +import { parseStatements } from '@tanstack/router-utils' import { getUniqueProgramIdentifier } from '../../utils' import type { HmrStyle } from '../../config' import type { ReferenceRouteCompilerPlugin } from '../plugins' -function capitalizeIdentifier(str: string) { - return str[0]!.toUpperCase() + str.slice(1) -} - -function createHotDataKey(exportName: string) { - return `tsr-split-component:${exportName}` -} - -const buildStableSplitComponentStatements = template.statements( - ` - const %%stableComponentIdent%% = (() => { - const hot = %%hotExpression%% - const hotData = hot ? (hot.data ??= {}) : undefined - return hotData?.[%%hotDataKey%%] ?? %%lazyRouteComponentIdent%%(%%localImporterIdent%%, %%exporterIdent%%) - })() - if (%%hotExpression%%) { - ((%%hotExpression%%).data ??= {})[%%hotDataKey%%] = %%stableComponentIdent%% - } - `, - { - syntacticPlaceholders: true, - }, -) - -function hotExpressionAstFor(hmrStyle: HmrStyle): t.Expression { - return template.expression.ast( - hmrStyle === 'webpack' ? 'import.meta.webpackHot' : 'import.meta.hot', - ) -} - export function createReactStableHmrSplitRouteComponentsPlugin(opts: { hmrStyle: HmrStyle }): ReferenceRouteCompilerPlugin { @@ -43,28 +13,29 @@ export function createReactStableHmrSplitRouteComponentsPlugin(opts: { if (ctx.splitNodeMeta.splitStrategy !== 'lazyRouteComponent') { return } - - const stableComponentIdent = getUniqueProgramIdentifier( - ctx.programPath, - `TSRSplit${capitalizeIdentifier(ctx.splitNodeMeta.exporterIdent)}`, + const exportName = ctx.splitNodeMeta.exporterIdent + const stable = getUniqueProgramIdentifier( + ctx.program, + `TSRSplit${exportName[0]!.toUpperCase()}${exportName.slice(1)}`, ) - - const hotDataKey = createHotDataKey(ctx.splitNodeMeta.exporterIdent) - - ctx.insertionPath.insertBefore( - buildStableSplitComponentStatements({ - stableComponentIdent, - hotDataKey: t.stringLiteral(hotDataKey), - hotExpression: hotExpressionAstFor(opts.hmrStyle), - lazyRouteComponentIdent: t.identifier(ctx.lazyRouteComponentIdent), - localImporterIdent: t.identifier( - ctx.splitNodeMeta.localImporterIdent, - ), - exporterIdent: t.stringLiteral(ctx.splitNodeMeta.exporterIdent), - }), + const hot = + opts.hmrStyle === 'webpack' + ? 'import.meta.webpackHot' + : 'import.meta.hot' + const key = JSON.stringify(`tsr-split-component:${exportName}`) + ctx.insertBefore( + parseStatements(` +const ${stable.name} = (() => { + const hot = ${hot} + const hotData = hot ? (hot.data ??= {}) : undefined + return hotData?.[${key}] ?? ${ctx.lazyRouteComponentIdent}(${ctx.splitNodeMeta.localImporterIdent}, ${JSON.stringify(exportName)}) +})() +if (${hot}) { + ((${hot}).data ??= {})[${key}] = ${stable.name} +} +`), ) - - return t.identifier(stableComponentIdent.name) + return b.Identifier({ name: stable.name }) }, } } diff --git a/packages/router-plugin/src/core/hmr/select-adapter.ts b/packages/router-plugin/src/core/hmr/select-adapter.ts index 60395a15349..5261b119a13 100644 --- a/packages/router-plugin/src/core/hmr/select-adapter.ts +++ b/packages/router-plugin/src/core/hmr/select-adapter.ts @@ -1,7 +1,7 @@ import { createViteHmrStatement } from './vite-adapter' import { createWebpackHmrStatement } from './webpack-adapter' import type { Config, HmrStyle } from '../config' -import type * as t from '@babel/types' +import type { ProgramStatement } from '@yuku-toolchain/types' export type CreateRouteHmrStatementOpts = { hmrStyle: HmrStyle @@ -17,7 +17,7 @@ export type CreateRouteHmrStatementOpts = { export function createRouteHmrStatement( stableRouteOptionKeys: Array, opts: CreateRouteHmrStatementOpts, -): Array { +): Array { const routeId = opts.routeId === '/__root' ? '__root__' : opts.routeId if (opts.hmrStyle === 'webpack') { diff --git a/packages/router-plugin/src/core/hmr/vite-adapter.ts b/packages/router-plugin/src/core/hmr/vite-adapter.ts index ba8d42a80ad..49ffac5c666 100644 --- a/packages/router-plugin/src/core/hmr/vite-adapter.ts +++ b/packages/router-plugin/src/core/hmr/vite-adapter.ts @@ -1,6 +1,6 @@ -import * as template from '@babel/template' +import { parseStatements } from '@tanstack/router-utils' import { getHandleRouteUpdateCode } from './handle-route-update' -import type * as t from '@babel/types' +import type { ProgramStatement } from '@yuku-toolchain/types' /** * Emits HMR accept code for Vite / native ESM HMR: `import.meta.hot.accept` @@ -15,16 +15,15 @@ export function createViteHmrStatement( opts: { routeId?: string } = {}, -): Array { +): Array { const handleRouteUpdateCode = getHandleRouteUpdateCode(stableRouteOptionKeys) // The replacement Route object can be uninitialized; keep a generated id as // fallback for the existing router route we need to patch. const routeIdFallback = typeof opts.routeId === 'string' ? JSON.stringify(opts.routeId) : 'Route.id' - return [ - template.statement( - ` + return parseStatements( + ` if (import.meta.hot) { const hot = import.meta.hot const hotData = hot.data ??= {} @@ -56,9 +55,5 @@ if (import.meta.hot) { }) } `, - { - syntacticPlaceholders: true, - }, - )(), - ] + ) } diff --git a/packages/router-plugin/src/core/hmr/webpack-adapter.ts b/packages/router-plugin/src/core/hmr/webpack-adapter.ts index eaf34ccfb18..f5696bb5b2c 100644 --- a/packages/router-plugin/src/core/hmr/webpack-adapter.ts +++ b/packages/router-plugin/src/core/hmr/webpack-adapter.ts @@ -1,7 +1,7 @@ -import * as template from '@babel/template' +import { parseStatements } from '@tanstack/router-utils' import { getHandleRouteUpdateCode } from './handle-route-update' import type { Config } from '../config' -import type * as t from '@babel/types' +import type { ProgramStatement } from '@yuku-toolchain/types' /** * Emits HMR accept code for bundlers with webpack-compatible `module.hot` @@ -21,7 +21,7 @@ export function createWebpackHmrStatement( targetFramework: Config['target'] routeId?: string }, -): Array { +): Array { const handleRouteUpdateCode = getHandleRouteUpdateCode(stableRouteOptionKeys) const staticRouteIdLiteral = typeof opts.routeId === 'string' @@ -63,9 +63,8 @@ export function createWebpackHmrStatement( } catch (_err) { /* noop */ }` : '' - return [ - template.statement( - ` + return parseStatements( + ` if (import.meta.webpackHot) { const hot = import.meta.webpackHot const hotData = hot.data ??= {} @@ -88,9 +87,5 @@ if (import.meta.webpackHot) { hot.accept() } `, - { - syntacticPlaceholders: true, - }, - )(), - ] + ) } diff --git a/packages/router-plugin/src/core/router-code-splitter-plugin.ts b/packages/router-plugin/src/core/router-code-splitter-plugin.ts index f1f75d4f3c1..f022bd6fcb0 100644 --- a/packages/router-plugin/src/core/router-code-splitter-plugin.ts +++ b/packages/router-plugin/src/core/router-code-splitter-plugin.ts @@ -7,6 +7,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url' import { decodeIdentifier, logDiff } from '@tanstack/router-utils' import { getConfig, splitGroupingsSchema } from './config' import { + analyzeRouteModule, compileCodeSplitReferenceRoute, compileCodeSplitSharedRoute, compileCodeSplitVirtualRoute, @@ -22,6 +23,7 @@ import { } from './constants' import { debug, normalizePath, routeFactoryCallCodeFilter } from './utils' import { createRouterPluginContext } from './router-plugin-context' +import type { RouteModuleAnalysis } from './code-splitter/compilers' import type { CodeSplitGroupings, SplitRouteIdentNodes } from './constants' import type { GetRoutesByFileMapResultValue } from '@tanstack/router-generator' import type { CodeSplitCompilerPlugin } from './code-splitter/plugins' @@ -116,6 +118,32 @@ export function createRouterCodeSplitterPlugin( // Map from normalized route file path → set of shared binding names. // Populated by the reference compiler, consumed by virtual and shared compilers. const sharedBindingsMap = new Map>() + // Cache only immutable source analysis; chunk settings and generated output + // stay per transform. A bounded cache avoids retaining every route AST. + const analyzedRoutes = new Map< + string, + { code: string; analysis: RouteModuleAnalysis } + >() + function getRouteAnalysis(code: string, id: string) { + const [pathname, query] = id.split('?') + const parameters = new URLSearchParams(query) + parameters.delete(tsrSplit) + parameters.delete(tsrShared) + const filename = parameters.size ? `${pathname}?${parameters}` : pathname! + const cached = analyzedRoutes.get(filename) + if (cached?.code === code) { + analyzedRoutes.delete(filename) + analyzedRoutes.set(filename, cached) + return cached.analysis + } + const analysis = analyzeRouteModule({ code, filename }) + analyzedRoutes.delete(filename) + analyzedRoutes.set(filename, { code, analysis }) + if (analyzedRoutes.size > 128) { + analyzedRoutes.delete(analyzedRoutes.keys().next().value!) + } + return analysis + } const getGlobalCodeSplitGroupings = () => { return ( @@ -137,6 +165,7 @@ export function createRouterCodeSplitterPlugin( const fromCode = detectCodeSplitGroupingsFromRoute({ code, filename: id, + analysis: getRouteAnalysis(code, id), }) if (fromCode.groupings !== undefined) { @@ -172,6 +201,7 @@ export function createRouterCodeSplitterPlugin( const sharedBindings = computeSharedBindings({ code, filename: id, + analysis: getRouteAnalysis(code, id), codeSplitGroupings: splitGroupings, }) if (sharedBindings.size > 0) { @@ -182,6 +212,7 @@ export function createRouterCodeSplitterPlugin( const compiledReferenceRoute = compileCodeSplitReferenceRoute({ code, + analysis: getRouteAnalysis(code, id), codeSplitGroupings: splitGroupings, targetFramework: userConfig.target, filename: id, @@ -239,6 +270,7 @@ export function createRouterCodeSplitterPlugin( const result = compileCodeSplitVirtualRoute({ code, + analysis: getRouteAnalysis(code, id), filename: id, splitTargets: grouping, sharedBindings: resolvedSharedBindings, @@ -257,6 +289,9 @@ export function createRouterCodeSplitterPlugin( { name: 'tanstack-router:code-splitter:compile-reference-file', enforce: 'pre', + buildEnd() { + analyzedRoutes.clear() + }, transform: { filter: { @@ -391,6 +426,7 @@ export function createRouterCodeSplitterPlugin( const result = compileCodeSplitSharedRoute({ code, + analysis: getRouteAnalysis(code, normalizedId), sharedBindings, filename: normalizedId, }) diff --git a/packages/router-plugin/src/core/router-hmr-plugin.ts b/packages/router-plugin/src/core/router-hmr-plugin.ts index e1dc01a43b1..d65eb3873db 100644 --- a/packages/router-plugin/src/core/router-hmr-plugin.ts +++ b/packages/router-plugin/src/core/router-hmr-plugin.ts @@ -1,4 +1,4 @@ -import { generateFromAst, logDiff, parseAst } from '@tanstack/router-utils' +import { analyzeModule, generateModule, logDiff } from '@tanstack/router-utils' import { compileCodeSplitReferenceRoute } from './code-splitter/compilers' import { getFrameworkHmrCompilerPlugins } from './code-splitter/plugins/framework-plugins' import { createRouteHmrStatement } from './hmr' @@ -76,18 +76,17 @@ export function createRouterHmrPlugin( } } - const ast = parseAst({ code, filename: normalizedId }) - ast.program.body.push( + const ast = analyzeModule({ code, filename: normalizedId }).ast + ast.body.push( ...createRouteHmrStatement([], { hmrStyle, targetFramework: userConfig.target, routeId: routeEntry.routeId, }), ) - const result = generateFromAst(ast, { - sourceMaps: true, + const result = generateModule(ast, { + source: code, filename: normalizedId, - sourceFileName: normalizedId, }) if (debug) { logDiff(code, result.code) diff --git a/packages/router-plugin/src/core/utils.ts b/packages/router-plugin/src/core/utils.ts index 61ab1ca278f..0bb6a885b81 100644 --- a/packages/router-plugin/src/core/utils.ts +++ b/packages/router-plugin/src/core/utils.ts @@ -1,5 +1,5 @@ -import * as t from '@babel/types' -import type babel from '@babel/core' +import { b, walk } from 'yuku-ast' +import type { Identifier, Program, Property } from '@yuku-toolchain/types' export const debug = process.env.TSR_VITE_DEBUG && @@ -22,45 +22,46 @@ export const routeFactoryCallCodeFilter = [ /\bcreateRootRouteWithContext\s*(?:<|\()/, ] -export function getObjectPropertyKeyName( - prop: t.ObjectProperty, -): string | undefined { +export function getObjectPropertyKeyName(prop: Property): string | undefined { if (prop.computed) { return undefined } - if (t.isIdentifier(prop.key)) { + if (prop.key.type === 'Identifier') { return prop.key.name } - if (t.isStringLiteral(prop.key)) { + if (prop.key.type === 'Literal' && typeof prop.key.value === 'string') { return prop.key.value } return undefined } +const reservedProgramNames = new WeakMap>() + export function getUniqueProgramIdentifier( - programPath: babel.NodePath, + program: Program, baseName: string, -): t.Identifier { +): Identifier { + let names = reservedProgramNames.get(program) + if (!names) { + names = new Set() + reservedProgramNames.set(program, names) + } + walk(program, { + Identifier(node) { + names.add(node.name) + }, + JSXIdentifier(node) { + names.add(node.name) + }, + }) let name = baseName let suffix = 2 - - const programScope = programPath.scope.getProgramParent() - - while ( - programScope.hasBinding(name) || - programScope.hasGlobal(name) || - programScope.hasReference(name) - ) { - name = `${baseName}${suffix}` - suffix++ + while (names.has(name)) { + name = `${baseName}${suffix++}` } - - // Register the name so subsequent calls within the same traversal - // see it and avoid collisions - programScope.references[name] = true - - return t.identifier(name) + names.add(name) + return b.Identifier({ name }) } diff --git a/packages/router-plugin/tests/add-hmr.test.ts b/packages/router-plugin/tests/add-hmr.test.ts index 98b3e61a5f9..971a0094ebd 100644 --- a/packages/router-plugin/tests/add-hmr.test.ts +++ b/packages/router-plugin/tests/add-hmr.test.ts @@ -1,6 +1,8 @@ import { readFile, readdir } from 'node:fs/promises' import path from 'node:path' import { describe, expect, it } from 'vitest' +import { is, walk } from 'yuku-ast' +import type { Node } from '@yuku-toolchain/types' import { compileCodeSplitReferenceRoute } from '../src/core/code-splitter/compilers' import { defaultCodeSplitGroupings } from '../src/core/constants' @@ -162,19 +164,31 @@ describe('add-hmr works', () => { expect(output).toContain('/posts') }) - it('prefers the current generated route id over stale Vite hot data', async () => { - const statement = createRouteHmrStatement([], { + it('prefers the current generated route id over stale Vite hot data', () => { + const statements = createRouteHmrStatement([], { hmrStyle: 'vite', targetFramework: 'react', routeId: '/current-route', }) - const output = JSON.stringify(statement) - - expect(output).toContain('"name":"initialRouteId"') - expect(output).toContain( - '"operator":"??","left":{"type":"StringLiteral","value":"/current-route"', - ) - expect(output).toContain('"object":{"type":"Identifier","name":"hotData"}') + let initializer: Node | null = null + for (const statement of statements) { + walk(statement, { + VariableDeclarator(node) { + if (is.Identifier(node.id) && node.id.name === 'initialRouteId') { + initializer = node.init + } + }, + }) + } + expect(initializer).toMatchObject({ + type: 'LogicalExpression', + operator: '??', + left: { type: 'Literal', value: '/current-route' }, + right: { + type: 'MemberExpression', + object: { type: 'Identifier', name: 'hotData' }, + }, + }) }) it('normalizes the generated root route id for Vite HMR', async () => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@false.tsx index 48e3768224b..8dcf4c3663f 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@false.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx index 4f32369e8f6..41aa3dbda00 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx @@ -1,34 +1,29 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; const TSRSplitComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: TSRSplitComponent -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: TSRSplitComponent }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("arrow-function.tsx", ['Route']); } @@ -45,9 +40,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -55,19 +52,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -76,6 +81,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -93,7 +101,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx index 12e47f429e6..0de14500f93 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx @@ -1,20 +1,17 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; const TSRSplitComponent = (() => { const hot = import.meta.webpackHot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.webpackHot) { - (import.meta.webpackHot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.webpackHot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: TSRSplitComponent -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: TSRSplitComponent }); if (import.meta.webpackHot) { const hot = import.meta.webpackHot; const hotData = hot.data ??= {}; @@ -31,9 +28,11 @@ if (import.meta.webpackHot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -41,19 +40,27 @@ if (import.meta.webpackHot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -62,6 +69,9 @@ if (import.meta.webpackHot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -76,9 +86,11 @@ if (import.meta.webpackHot) { if (tsrEnqueueUpdate) { tsrEnqueueUpdate(() => {}); } - } catch (_err) {} + } catch (_err) { + /* noop */ + } } - hot.dispose(data => { + hot.dispose((data) => { if (routeId) { data['tsr-route-id'] = routeId; } diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@false.tsx index a2983e31bdf..6b21b9e9c7e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@false.tsx @@ -1,12 +1,8 @@ -const $$splitComponentImporter = () => import('createFileRoute-lowercase-components.tsx?tsr-split=component'); -const $$splitErrorComponentImporter = () => import('createFileRoute-lowercase-components.tsx?tsr-split=errorComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("createFileRoute-lowercase-components.tsx?tsr-split=component"); +const $$splitErrorComponentImporter = () => import("createFileRoute-lowercase-components.tsx?tsr-split=errorComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/lowercase-components')({ - pendingComponent: pendingComponent, - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/lowercase-components')({ pendingComponent: pendingComponent, errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"), component: lazyRouteComponent($$splitComponentImporter, "component") }); function pendingComponent() { return
Pending
; } \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx index 70c428363e6..686721dee87 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx @@ -1,28 +1,24 @@ -const $$splitComponentImporter = () => import('createFileRoute-lowercase-components.tsx?tsr-split=component'); -const $$splitErrorComponentImporter = () => import('createFileRoute-lowercase-components.tsx?tsr-split=errorComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("createFileRoute-lowercase-components.tsx?tsr-split=component"); +const $$splitErrorComponentImporter = () => import("createFileRoute-lowercase-components.tsx?tsr-split=errorComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; const TSRSplitErrorComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; } const TSRSplitComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } -export const Route = createFileRoute('/lowercase-components')({ - pendingComponent: TSRPendingComponent, - errorComponent: TSRSplitErrorComponent, - component: TSRSplitComponent -}); +export const Route = createFileRoute('/lowercase-components')({ pendingComponent: TSRPendingComponent, errorComponent: TSRSplitErrorComponent, component: TSRSplitComponent }); function TSRPendingComponent() { return
Pending
; } @@ -32,14 +28,12 @@ if (hot && typeof window !== 'undefined') { const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("createFileRoute-lowercase-components.tsx", ['Route']); } @@ -56,9 +50,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -66,19 +62,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -87,6 +91,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -104,7 +111,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx index e5a473dc142..b7a67fb777f 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx @@ -1,23 +1,19 @@ import * as React from 'react'; import { createRootRoute } from '@tanstack/react-router'; const TSRComponent = () =>
root hmr
; -export const Route = createRootRoute({ - component: TSRComponent -}); +export const Route = createRootRoute({ component: TSRComponent }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("createRootRoute-inline-component.tsx", ['Route']); } @@ -34,9 +30,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -44,19 +42,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -65,6 +71,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -82,7 +91,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx index cb5014cd35b..aa70848f35a 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx @@ -1,14 +1,6 @@ -import * as React from 'react'; import { createRootRoute } from '@tanstack/react-router'; -export const Route = createRootRoute({ - shellComponent: TSRShellComponent, - pendingComponent: TSRPendingComponent, - errorComponent: TSRErrorComponent, - component: TSRComponent -}); -function TSRShellComponent({ - children -}: { +export const Route = createRootRoute({ shellComponent: TSRShellComponent, pendingComponent: TSRPendingComponent, errorComponent: TSRErrorComponent, component: TSRComponent }); +function TSRShellComponent({ children }: { children: React.ReactNode; }) { return {children}; @@ -28,14 +20,12 @@ if (hot && typeof window !== 'undefined') { const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("createRootRoute-lowercase-components.tsx", ['Route']); } @@ -52,9 +42,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -62,19 +54,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -83,6 +83,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -100,7 +103,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx index 7ba271c212d..aa27e6ccb1c 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx @@ -1,8 +1,6 @@ import * as React from 'react'; import { createRootRoute } from '@tanstack/react-router'; -export const Route = createRootRoute({ - component: RootComponent -}); +export const Route = createRootRoute({ component: RootComponent }); function RootComponent() { return
Hello
; } @@ -12,14 +10,12 @@ if (hot && typeof window !== 'undefined') { const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("createRootRoute.tsx", ['Route']); } @@ -36,9 +32,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -46,19 +44,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -67,6 +73,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -84,7 +93,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx index b66449aebfe..aa633e6852e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx @@ -3,9 +3,7 @@ import { createRootRouteWithContext } from '@tanstack/react-router'; interface MyRouterContext { auth: boolean; } -export const Route = createRootRouteWithContext()({ - component: RootComponent -}); +export const Route = createRootRouteWithContext()({ component: RootComponent }); function RootComponent() { return
Hello
; } @@ -15,14 +13,12 @@ if (hot && typeof window !== 'undefined') { const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("createRootRouteWithContext-type-args.tsx", ['Route']); } @@ -39,9 +35,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -49,19 +47,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -70,6 +76,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -87,7 +96,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx index fee0b2f2e6e..d9e69eb3d0e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx @@ -1,22 +1,18 @@ import React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: undefined -}); +export const Route = createFileRoute('/')({ component: undefined }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("explicit-undefined-component.tsx", ['Route']); } @@ -33,9 +29,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -43,19 +41,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -64,6 +70,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -81,7 +90,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@false.tsx index 5d7e2181f58..00103f9c385 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@false.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('function-declaration.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("function-declaration.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx index 4a925828e27..1debdc3d250 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx @@ -1,34 +1,29 @@ -const $$splitComponentImporter = () => import('function-declaration.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("function-declaration.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; const TSRSplitComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: TSRSplitComponent -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: TSRSplitComponent }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("function-declaration.tsx", ['Route']); } @@ -45,9 +40,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -55,19 +52,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -76,6 +81,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -93,7 +101,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@false.tsx index 653c0c21f5d..a3677e64ffc 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@false.tsx @@ -1,11 +1,7 @@ -const $$splitErrorComponentImporter = () => import('multi-component.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('multi-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("multi-component.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("multi-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx index ca2a7ab2e2d..5bed66ff85e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx @@ -1,44 +1,38 @@ -const $$splitErrorComponentImporter = () => import('multi-component.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('multi-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("multi-component.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("multi-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; const TSRSplitComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } const TSRSplitErrorComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; } -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: TSRSplitComponent, - errorComponent: TSRSplitErrorComponent -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: TSRSplitComponent, errorComponent: TSRSplitErrorComponent }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("multi-component.tsx", ['Route']); } @@ -55,9 +49,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -65,19 +61,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -86,6 +90,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -103,7 +110,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@false.tsx index 4fc3129e144..6939c2a783f 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@false.tsx @@ -1,11 +1,7 @@ -const $$splitErrorComponentImporter = () => import('string-literal-keys.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('string-literal-keys.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("string-literal-keys.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("string-literal-keys.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - 'component': lazyRouteComponent($$splitComponentImporter, 'component'), - 'errorComponent': lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, 'component': lazyRouteComponent($$splitComponentImporter, "component"), 'errorComponent': lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx index b6f67e67b14..28dd1b9a910 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx @@ -1,44 +1,38 @@ -const $$splitErrorComponentImporter = () => import('string-literal-keys.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('string-literal-keys.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("string-literal-keys.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("string-literal-keys.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; const TSRSplitComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:component"] ?? lazyRouteComponent($$splitComponentImporter, "component"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:component"] = TSRSplitComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:component"] = TSRSplitComponent; } const TSRSplitErrorComponent = (() => { const hot = import.meta.hot; - const hotData = hot ? hot.data ??= {} : undefined; + const hotData = hot ? (hot.data ??= {}) : undefined; return hotData?.["tsr-split-component:errorComponent"] ?? lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"); })(); if (import.meta.hot) { - (import.meta.hot.data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; + ((import.meta.hot).data ??= {})["tsr-split-component:errorComponent"] = TSRSplitErrorComponent; } -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - 'component': TSRSplitComponent, - 'errorComponent': TSRSplitErrorComponent -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, 'component': TSRSplitComponent, 'errorComponent': TSRSplitErrorComponent }); const hot = import.meta.hot; if (hot && typeof window !== 'undefined') { hot.data ??= {}; const tsrReactRefresh = window.__TSR_REACT_REFRESH__ ??= (() => { const ignoredExportsById = new Map(); const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports; - window.__getReactRefreshIgnoredExports = ctx => { + window.__getReactRefreshIgnoredExports = (ctx) => { const ignoredExports = previousGetIgnoredExports?.(ctx) ?? []; const moduleIgnored = ignoredExportsById.get(ctx.id) ?? []; return [...ignoredExports, ...moduleIgnored]; }; - return { - ignoredExportsById - }; + return { ignoredExportsById }; })(); tsrReactRefresh.ignoredExportsById.set("string-literal-keys.tsx", ['Route']); } @@ -55,9 +49,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -65,19 +61,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = ["component", "shellComponent", "pendingComponent", "errorComponent", "notFoundComponent"]; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -86,6 +90,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -103,7 +110,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@false.tsx index b09548da578..80eb551a164 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@false.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@false.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/solid-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/solid-router"; import { createFileRoute } from '@tanstack/solid-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx index 754da5c9025..7be4ca937fa 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx @@ -1,11 +1,8 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/solid-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/solid-router"; import { createFileRoute } from '@tanstack/solid-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); if (import.meta.hot) { const hot = import.meta.hot; const hotData = hot.data ??= {}; @@ -16,9 +13,11 @@ if (import.meta.hot) { return; } ; + // Generated route-tree options are not present on the freshly imported route + // module, but they must stay on the live route before rebuilding indexes. const generatedRouteOptionKeys = new Set(["id", "path", "getParentRoute"]); const generatedRouteOptions = {}; - generatedRouteOptionKeys.forEach(key => { + generatedRouteOptionKeys.forEach((key) => { if (key in oldRoute.options) { generatedRouteOptions[key] = oldRoute.options[key]; } @@ -26,19 +25,27 @@ if (import.meta.hot) { const oldHasShellComponent = "shellComponent" in oldRoute.options; const newHasShellComponent = "shellComponent" in newRoute.options; const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent; + // Keys whose identity must remain stable to prevent React from + // unmounting/remounting the component tree. React Fast Refresh already + // handles hot-updating the function bodies of these components — our job + // is only to update non-component route options (loader, head, etc.). + // For code-split (splittable) routes, the lazyRouteComponent wrapper is + // already cached in the bundler hot data so its identity is stable. + // For unsplittable routes (e.g. root routes), the component is a plain + // function reference that gets recreated on every module re-execution, + // so we must explicitly preserve the old reference. + // Preserve component identity so React doesn't remount. + // React Fast Refresh patches the function bodies in-place. const componentKeys = []; if (preserveComponentIdentity) { - componentKeys.forEach(key => { + componentKeys.forEach((key) => { if (key in oldRoute.options && key in newRoute.options) { newRoute.options[key] = oldRoute.options[key]; } }); } ; - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions - }; + const nextOptions = { ...newRoute.options, ...generatedRouteOptions }; oldRoute.options = nextOptions; oldRoute.update(nextOptions); router._replaceRouteChunk(oldRoute, newRoute.lazyFn); @@ -47,6 +54,9 @@ if (import.meta.hot) { router.resolvePathCache.clear(); void router._refreshRoute?.(); function syncHotRouteExport(liveRoute) { + // routeTree.gen.ts mutates the original module export with generated + // routing state. Mirror that state onto the fresh HMR export too, so + // aliased route imports keep working after the module is hot-reloaded. newRoute.options = liveRoute.options; newRoute.parentRoute = liveRoute.parentRoute; newRoute._path = liveRoute._path; @@ -64,7 +74,7 @@ if (import.meta.hot) { handleRouteUpdate(initialRouteId, Route); hotData['tsr-route-update-handled'] = Route; } - hot.accept(newModule => { + hot.accept((newModule) => { if (Route && newModule && newModule.Route) { const routeId = hotData['tsr-route-id'] ?? Route.id; if (routeId) { diff --git a/packages/router-plugin/tests/code-splitter.test.ts b/packages/router-plugin/tests/code-splitter.test.ts index 967f102e4d4..b61857668a3 100644 --- a/packages/router-plugin/tests/code-splitter.test.ts +++ b/packages/router-plugin/tests/code-splitter.test.ts @@ -1,22 +1,15 @@ import { readFile, readdir } from 'node:fs/promises' import path from 'node:path' import { describe, expect, it } from 'vitest' -import { parseAst } from '@tanstack/router-utils' +import { analyzeModule } from '@tanstack/router-utils' +import { SymbolFlags } from 'yuku-analyzer' import { - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromNode, - collectLocalBindingsFromStatement, - collectModuleLevelRefsFromNode, + analyzeRouteModule, compileCodeSplitReferenceRoute, compileCodeSplitSharedRoute, compileCodeSplitVirtualRoute, computeSharedBindings, - expandDestructuredDeclarations, - expandSharedDestructuredDeclarators, - expandTransitively, - removeBindingsDependingOnRoute, } from '../src/core/code-splitter/compilers' import { createIdentifier } from '@tanstack/router-utils' import { defaultCodeSplitGroupings } from '../src/core/constants' @@ -57,6 +50,54 @@ const testGroups: Array<{ name: string; groupings: CodeSplitGroupings }> = [ }, ] +it('reuses immutable route analysis regardless of output generation order', () => { + const code = `'use client'; +import { createFileRoute } from '@tanstack/react-router' +const state = {count: 0} +export const Route = createFileRoute('/')({loader: () => state, component: () => state.count})` + const analysis = analyzeRouteModule({ code, filename: 'route.tsx' }) + const original = JSON.stringify(analysis.module.ast) + const sharedBindings = computeSharedBindings({ + code, + analysis, + codeSplitGroupings: defaultCodeSplitGroupings, + }) + const reference = () => + compileCodeSplitReferenceRoute({ + code, + analysis, + sharedBindings, + filename: 'route.tsx', + id: 'route.tsx', + targetFramework: 'react', + addHmr: false, + codeSplitGroupings: defaultCodeSplitGroupings, + }) + const component = () => + compileCodeSplitVirtualRoute({ + code, + analysis, + sharedBindings, + filename: 'route.tsx?tsr-split=component', + splitTargets: ['component'], + }) + const firstComponent = component() + const firstReference = reference() + const shared = compileCodeSplitSharedRoute({ + code, + analysis, + sharedBindings, + filename: 'route.tsx?tsr-shared=1', + }) + for (const output of [firstReference, firstComponent, shared]) { + expect(output?.code).toMatch(/^['"]use client['"]/) + } + expect(reference()).toEqual(firstReference) + expect(component()).toEqual(firstComponent) + expect(JSON.stringify(analysis.module.ast)).toBe(original) + expect(analysis.module.rootScope.find('state')?.references).toHaveLength(2) +}) + describe('code-splitter works', () => { describe.each(frameworks)('FRAMEWORK=%s', (framework) => { describe.each(testGroups)( @@ -86,6 +127,9 @@ describe('code-splitter works', () => { sharedBindings: sharedBindings.size > 0 ? sharedBindings : undefined, }) + if (compileResult) { + analyzeModule({ code: compileResult.code, filename }) + } await expect(compileResult?.code || code).toMatchFileSnapshot( path.join(dirs.snapshots, groupName, filename), @@ -114,6 +158,7 @@ describe('code-splitter works', () => { sharedBindings: sharedBindings.size > 0 ? sharedBindings : undefined, }) + analyzeModule({ code: splitResult.code, filename }) const snapshotFilename = path.join( dirs.snapshots, @@ -155,6 +200,7 @@ describe('code-splitter works', () => { sharedBindings, filename: `${filename}?tsr-shared=1`, }) + analyzeModule({ code: sharedResult.code, filename }) await expect(sharedResult.code).toMatchFileSnapshot( snapshotFilename, @@ -309,270 +355,18 @@ export const Route = createFileRoute('/')({ // independent of any particular route file. // ============================================================================ -describe('expandTransitively', () => { - it('is idempotent — running twice yields the same result as once', () => { - // Graph: a -> b -> c, d -> b - const depGraph = new Map>([ - ['a', new Set(['b'])], - ['b', new Set(['c'])], - ['c', new Set()], - ['d', new Set(['b'])], - ]) - - const first = new Set(['a']) - expandTransitively(first, depGraph) - const afterFirst = new Set(first) - - expandTransitively(first, depGraph) - expect(first).toEqual(afterFirst) - }) - - it('is monotone — larger initial set produces equal or larger result', () => { - const depGraph = new Map>([ - ['a', new Set(['c'])], - ['b', new Set(['d'])], - ['c', new Set()], - ['d', new Set()], - ]) - - const small = new Set(['a']) - expandTransitively(small, depGraph) - - const large = new Set(['a', 'b']) - expandTransitively(large, depGraph) - - for (const item of small) { - expect(large.has(item)).toBe(true) - } - }) - - it('handles cycles without infinite loops', () => { - const depGraph = new Map>([ - ['a', new Set(['b'])], - ['b', new Set(['c'])], - ['c', new Set(['a'])], - ]) - - const set = new Set(['a']) - expandTransitively(set, depGraph) - expect(set).toEqual(new Set(['a', 'b', 'c'])) - }) - - it('is a no-op when there are no dependencies', () => { - const depGraph = new Map>([ - ['a', new Set()], - ['b', new Set()], - ]) - - const set = new Set(['a']) - expandTransitively(set, depGraph) - expect(set).toEqual(new Set(['a'])) - }) - - it('handles missing entries in the graph gracefully', () => { - const depGraph = new Map>() - const set = new Set(['unknown']) - expandTransitively(set, depGraph) - expect(set).toEqual(new Set(['unknown'])) - }) -}) - -describe('buildDependencyGraph', () => { - it('result keys are a subset of localBindings', () => { - const code = ` -const a = 1 -const b = a + 1 -const c = 2 -` - const ast = parseAst({ code }) - const declMap = buildDeclarationMap(ast) - const localBindings = new Set(['a', 'b', 'c']) - const graph = buildDependencyGraph(declMap, localBindings) - - for (const key of graph.keys()) { - expect(localBindings.has(key)).toBe(true) - } - }) - - it('dependency values are also subsets of localBindings', () => { - const code = ` -import { external } from 'somewhere' -const a = external -const b = a + 1 -` - const ast = parseAst({ code }) - const declMap = buildDeclarationMap(ast) - const localBindings = new Set(['a', 'b']) - const graph = buildDependencyGraph(declMap, localBindings) - - for (const deps of graph.values()) { - for (const dep of deps) { - expect(localBindings.has(dep)).toBe(true) - } - } - }) - - it('captures direct references correctly', () => { - const code = ` -const x = 10 -const y = x + 1 -` - const ast = parseAst({ code }) - const declMap = buildDeclarationMap(ast) - const localBindings = new Set(['x', 'y']) - const graph = buildDependencyGraph(declMap, localBindings) - - expect(graph.get('y')).toEqual(new Set(['x'])) - expect(graph.get('x')?.size ?? 0).toBe(0) - }) -}) - -describe('removeBindingsDependingOnRoute', () => { - it('removes bindings that directly reference Route', () => { - const depGraph = new Map>([ - ['helper', new Set(['Route'])], - ['standalone', new Set()], - ['Route', new Set()], - ]) - - const shared = new Set(['helper', 'standalone']) - removeBindingsDependingOnRoute(shared, depGraph) - - expect(shared.has('helper')).toBe(false) - expect(shared.has('standalone')).toBe(true) - }) - - it('removes bindings that transitively reference Route', () => { - const depGraph = new Map>([ - ['a', new Set(['b'])], - ['b', new Set(['Route'])], - ['c', new Set()], - ['Route', new Set()], - ]) - - const shared = new Set(['a', 'c']) - removeBindingsDependingOnRoute(shared, depGraph) - - expect(shared.has('a')).toBe(false) - expect(shared.has('c')).toBe(true) - }) - - it('is a no-op when nothing depends on Route', () => { - const depGraph = new Map>([ - ['a', new Set(['b'])], - ['b', new Set()], - ['Route', new Set()], - ]) - - const shared = new Set(['a', 'b']) - const before = new Set(shared) - removeBindingsDependingOnRoute(shared, depGraph) - - expect(shared).toEqual(before) - }) -}) - -describe('expandDestructuredDeclarations', () => { - it('is idempotent', () => { - const code = `const { a, b } = fn()` - const ast = parseAst({ code }) - - const shared = new Set(['a']) - expandDestructuredDeclarations(ast, shared) - const afterFirst = new Set(shared) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toEqual(afterFirst) - }) - - it('pulls all siblings when one destructured binding is shared', () => { - const code = `const { a, b, c } = fn()` - const ast = parseAst({ code }) - - const shared = new Set(['b']) - expandDestructuredDeclarations(ast, shared) - - expect(shared).toEqual(new Set(['a', 'b', 'c'])) - }) - - it('does not affect non-destructured declarations', () => { - const code = ` -const x = 1 -const y = 2 -` - const ast = parseAst({ code }) - - const shared = new Set(['x']) - expandDestructuredDeclarations(ast, shared) - - expect(shared).toEqual(new Set(['x'])) - }) -}) - -describe('collectLocalBindingsFromStatement', () => { - it('collects variable declaration names', () => { - const code = `const x = 1` - const ast = parseAst({ code }) - const bindings = new Set() - collectLocalBindingsFromStatement(ast.program.body[0]!, bindings) - expect(bindings).toEqual(new Set(['x'])) - }) - - it('collects function declaration names', () => { - const code = `function foo() {}` - const ast = parseAst({ code }) - const bindings = new Set() - collectLocalBindingsFromStatement(ast.program.body[0]!, bindings) - expect(bindings).toEqual(new Set(['foo'])) - }) - - it('collects class declaration names', () => { - const code = `class MyClass {}` - const ast = parseAst({ code }) - const bindings = new Set() - collectLocalBindingsFromStatement(ast.program.body[0]!, bindings) - expect(bindings).toEqual(new Set(['MyClass'])) - }) - - it('collects exported declaration names', () => { - const code = `export const a = 1` - const ast = parseAst({ code }) - const bindings = new Set() - collectLocalBindingsFromStatement(ast.program.body[0]!, bindings) - expect(bindings).toEqual(new Set(['a'])) - }) - - it('collects destructured binding names', () => { - const code = `const { a, b } = obj` - const ast = parseAst({ code }) - const bindings = new Set() - collectLocalBindingsFromStatement(ast.program.body[0]!, bindings) - expect(bindings).toEqual(new Set(['a', 'b'])) - }) -}) - -// ============================================================================ -// LAYER 2: Invariant Tests on computeSharedBindings -// -// These verify the core "contracts" of the shared bindings computation: -// - Route is never extracted -// - Results are always real local bindings -// - Destructured cohesion holds -// - Transitive dependencies are included -// - Route-dependent bindings are excluded -// ============================================================================ - describe('computeSharedBindings invariants', () => { const defaultGroupings = defaultCodeSplitGroupings function getLocalBindings(code: string): Set { - const ast = parseAst({ code }) - const bindings = new Set() - for (const stmt of ast.program.body) { - collectLocalBindingsFromStatement(stmt, bindings) - } - bindings.delete('Route') - return bindings + return new Set( + analyzeModule({ code }) + .rootScope.bindings.filter( + (symbol) => + !symbol.has(SymbolFlags.Import) && symbol.name !== 'Route', + ) + .map((symbol) => symbol.name), + ) } it('INVARIANT: Route is never in the shared set', () => { @@ -1090,12 +884,14 @@ export const Route = createFileRoute('/')({ expect(result.has('Route')).toBe(false) // Contract 2: all results are real local bindings - const ast = parseAst({ code }) - const localBindings = new Set() - for (const stmt of ast.program.body) { - collectLocalBindingsFromStatement(stmt, localBindings) - } - localBindings.delete('Route') + const localBindings = new Set( + analyzeModule({ code }) + .rootScope.bindings.filter( + (symbol) => + !symbol.has(SymbolFlags.Import) && symbol.name !== 'Route', + ) + .map((symbol) => symbol.name), + ) for (const name of result) { expect(localBindings.has(name)).toBe(true) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function.tsx index 48e3768224b..8dcf4c3663f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@component.tsx index 7fe3edee112..d5f6a179ae7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/arrow-function@component.tsx @@ -1,27 +1,20 @@ +import { Route } from "arrow-function.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals.tsx index 771fd14f8b8..50740da19be 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals.tsx @@ -1,13 +1,5 @@ -const $$splitComponentImporter = () => import('boolean-null-literals.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("boolean-null-literals.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/router'; - // Test errorComponent with false literal -export const Route = createFileRoute('/test')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: false, - pendingComponent: null, - loader: async () => ({ - data: 'test' - }) -}); \ No newline at end of file +export const Route = createFileRoute('/test')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: false, pendingComponent: null, loader: async () => ({ data: 'test' }) }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@component.tsx index c49c9e93a31..8d69627049a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/boolean-null-literals@component.tsx @@ -1,3 +1,2 @@ -// Test errorComponent with false literal const SplitComponent = () =>
Test Component
; export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese.tsx index 2ffcfaa9a2a..696048e718d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese.tsx @@ -1,10 +1,8 @@ -const $$splitComponentImporter = () => import('chinese.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("chinese.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); interface DemoProps { title: string; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@component.tsx index 003ca944a17..00cdecb00f0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/chinese@component.tsx @@ -1,23 +1,16 @@ import * as React from 'react'; function HomeComponent() { - return
+ return (
-
; +
); } interface DemoProps { title: string; } -function Demo({ - title -}: DemoProps) { - return

+function Demo({ title }: DemoProps) { + return (

{title} -

; + ); } export { HomeComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function.tsx index 6ec23e8d1ce..071c6214806 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function@component.tsx index 39ace71ebea..956d9ca51b9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-arrow-function@component.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } const App = () => { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); }; function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function.tsx index 202ef21eb3c..f3c919ecce8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function@component.tsx index 96a753ad8a6..3a38522bce8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/circular-reference-function@component.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } function App() { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); } function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/conditional-properties.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/conditional-properties.tsx index 70385cd7491..63cac8767ab 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/conditional-properties.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/conditional-properties.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('conditional-properties.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("conditional-properties.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { isEnabled } from '@features/feature-flags'; import TrueImport from '@modules/true-component'; import { falseLoader } from '@modules/false-component'; -export const Route = createFileRoute('/posts')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: isEnabled ? TrueImport.loader : falseLoader -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: isEnabled ? TrueImport.loader : falseLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple.tsx index dcf67bfcb47..e12f4dc4e86 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple.tsx @@ -1,15 +1,7 @@ -const $$splitComponentImporter = () => import('destructured-export-multiple.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-multiple.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const getConfig = () => ({ - baseUrl: 'https://api.example.com', - timeout: 5000 -}); -export const { - baseUrl, - timeout -} = getConfig(); +export const getConfig = () => ({ baseUrl: 'https://api.example.com', timeout: 5000 }); +export const { baseUrl, timeout } = getConfig(); export const [first, second] = [1, 2]; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple@component.tsx index 9441b5a6893..760ed079749 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-multiple@component.tsx @@ -1,8 +1,8 @@ import { baseUrl, timeout } from "destructured-export-multiple.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

Timeout: {timeout}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested.tsx index 6793123b2f3..6e5aa231c1b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested.tsx @@ -1,19 +1,6 @@ -const $$splitComponentImporter = () => import('destructured-export-nested.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-nested.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -const getConfig = () => ({ - api: { - baseUrl: 'https://api.example.com' - }, - timeout: 5000, - extra: 'data' -}); -export const { - api: { - baseUrl - }, - ...rest -} = getConfig(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const getConfig = () => ({ api: { baseUrl: 'https://api.example.com' }, timeout: 5000, extra: 'data' }); +export const { api: { baseUrl }, ...rest } = getConfig(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested@component.tsx index 8ba46e33e13..a25215497c2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export-nested@component.tsx @@ -1,7 +1,7 @@ import { baseUrl } from "destructured-export-nested.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export.tsx index 31b1bfbe8bf..3cc4e238685 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export.tsx @@ -1,17 +1,8 @@ -const $$splitComponentImporter = () => import('destructured-export.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; + return { getObject: () => ({ constA: 10, constB: 5 }) }; } -export const { - getObject -} = getObjectCallback(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const { getObject } = getObjectCallback(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@component.tsx index f58942d5afc..63047f4c051 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@component.tsx @@ -1,14 +1,6 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} function AboutComponent() { - return
+ return (

About

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@errorComponent.tsx index 45fb19eecd8..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@errorComponent.tsx @@ -1,8 +0,0 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@notFoundComponent.tsx index 45fb19eecd8..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-export@notFoundComponent.tsx @@ -1,8 +0,0 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-react-memo-imported-component.tsx index ee2af1cf9b2..0b22750beae 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-react-memo-imported-component.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('destructured-react-memo-imported-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-react-memo-imported-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedLoader } from '../../shared/imported'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: importedLoader -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: importedLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults.tsx index 7c54a2c145a..96cf1d3fc37 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults.tsx @@ -1,8 +1,5 @@ import { loader } from "destructured-route-options-defaults.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('destructured-route-options-defaults.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-route-options-defaults.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults@shared.tsx index fdc9acef5bb..ca395ad4c38 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructured-route-options-defaults@shared.tsx @@ -1,22 +1,12 @@ function defaultLoader() { - return { - message: 'default' - }; + return { message: 'default' }; } function DefaultComponent() { return
Default
; } -const createBits = () => ({ - component: ActualComponent, - loader: () => ({ - message: 'hello' - }) -}); -const { - component: MyComponent = DefaultComponent, - loader = defaultLoader -} = createBits(); +const createBits = () => ({ component: ActualComponent, loader: () => ({ message: 'hello' }) }); +const { component: MyComponent = DefaultComponent, loader = defaultLoader } = createBits(); function ActualComponent() { return
About
; } -export { ActualComponent, createBits, DefaultComponent, defaultLoader, loader, MyComponent }; \ No newline at end of file +export { ActualComponent, DefaultComponent, MyComponent, createBits, defaultLoader, loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@component.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@component.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@errorComponent.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@errorComponent.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@notFoundComponent.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring@notFoundComponent.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue.tsx index 68f8be03644..b6c5e985ccd 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue.tsx @@ -1,8 +1,5 @@ 'use client'; - -const $$splitComponentImporter = () => import('directive-prologue.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("directive-prologue.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/directive')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/directive')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue@component.tsx index ce7cd5e5ee1..d99c313cdd9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/directive-prologue@component.tsx @@ -1,5 +1,4 @@ 'use client'; - const SplitComponent = () => { return
directive preserved
; }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component-and-normal-notFound.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component-and-normal-notFound.tsx index da4daa9a3f7..e33e7496752 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component-and-normal-notFound.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component-and-normal-notFound.tsx @@ -1,15 +1,12 @@ console.warn("[tanstack-router] These exports from \"export-default-component-and-normal-notFound.tsx\" will not be code-split and will increase your bundle size:\n- Home\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitNotFoundComponentImporter = () => import('export-default-component-and-normal-notFound.tsx?tsr-split=notFoundComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("export-default-component-and-normal-notFound.tsx?tsr-split=notFoundComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import React, { useState } from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/home')({ - component: Home, - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); +export const Route = createFileRoute('/home')({ component: Home, notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); export default function Home() { const [one, setOne] = useState('this is from a state'); - return
+ return (

{one}

-
; +
); } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration.tsx index 5d7e2181f58..00103f9c385 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('function-declaration.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("function-declaration.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration@component.tsx index 3476c52d544..b50aa2a7c66 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-declaration@component.tsx @@ -1,27 +1,20 @@ +import { Route } from "function-declaration.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; -import { Route } from "function-declaration.tsx"; function PostsComponent() { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); } export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute.tsx index df71217488b..9af3dedddf3 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/importAttribute.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('importAttribute.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("importAttribute.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader.tsx index 2271ab44542..fa5de7d91e4 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('imported-default-component-destructured-loader.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported-default-component-destructured-loader.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedLoader } from '../../shared/imported'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: importedLoader -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: importedLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader@component.tsx index d21b198c985..25df3bb3542 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component-destructured-loader@component.tsx @@ -1,3 +1,2 @@ import importedComponent from '../../shared/imported'; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component.tsx index dcd6f3d5e06..139421d6349 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('imported-default-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported-default-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component@component.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-default-component@component.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent.tsx index 898e1b36185..ef941a7961a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent.tsx @@ -1,8 +1,5 @@ -const $$splitErrorComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@component.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@component.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@errorComponent.tsx index 7a8654fb942..e53f72933db 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-errorComponent@errorComponent.tsx @@ -1,3 +1,2 @@ import { importedErrorComponent } from '../../shared/imported'; -const SplitErrorComponent = importedErrorComponent; -export { SplitErrorComponent as errorComponent }; \ No newline at end of file +export { importedErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent.tsx index 4c5c19cfcf2..8b5ec5e2b86 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent.tsx @@ -1,8 +1,5 @@ -const $$splitNotFoundComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=notFoundComponent'); -const $$splitComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=notFoundComponent"); +const $$splitComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@component.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@component.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@notFoundComponent.tsx index c6cfd9797f0..9cd48bd8599 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-notFoundComponent@notFoundComponent.tsx @@ -1,3 +1,2 @@ import { importedNotFoundComponent } from '../../shared/imported'; -const SplitNotFoundComponent = importedNotFoundComponent; -export { SplitNotFoundComponent as notFoundComponent }; \ No newline at end of file +export { importedNotFoundComponent as notFoundComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent.tsx index 17adf19f064..656459eb678 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('imported-pendingComponent.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported-pendingComponent.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedPendingComponent } from '../../shared/imported'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent: importedPendingComponent -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent: importedPendingComponent }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent@component.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported-pendingComponent@component.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported.tsx index e92f76cf982..e795a6e941b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('imported.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedLoader } from '../../shared'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: importedLoader -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: importedLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@component.tsx index 5bc9da8d43b..03c69c46e37 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/imported@component.tsx @@ -1,3 +1,2 @@ import { importedComponent } from '../../shared'; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline.tsx index c2b4dae4160..b340655ca65 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline.tsx @@ -1,9 +1,7 @@ -const $$splitComponentImporter = () => import('inline.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("inline.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); Route.addChildren([]); export const test = 'test'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@component.tsx index 58ccfb29032..da91d03e3d0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@component.tsx @@ -1,3 +1,4 @@ +import { Route, test } from "inline.tsx"; import * as React from 'react'; import * as styles from '../style.css'; import { TEST_DATA } from '../test.const'; @@ -6,13 +7,11 @@ const Button = (props: { }) => { return ; }; -import { Route } from "inline.tsx"; -import { test } from "inline.tsx"; const SplitComponent = () => { - return
+ return (
{test}

{TEST_DATA.welcome}

-
; +
); }; export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@errorComponent.tsx index 9236af60214..bd863dd8f99 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@errorComponent.tsx @@ -1,2 +1,2 @@ -import * as React from 'react'; -import { Route } from "inline.tsx"; \ No newline at end of file +import { Route } from "inline.tsx"; +import * as React from 'react'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@notFoundComponent.tsx index 9236af60214..bd863dd8f99 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline@notFoundComponent.tsx @@ -1,2 +1,2 @@ -import * as React from 'react'; -import { Route } from "inline.tsx"; \ No newline at end of file +import { Route } from "inline.tsx"; +import * as React from 'react'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/lowercase-function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/lowercase-function-declaration.tsx index b2f908ab451..63e3be49d63 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/lowercase-function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/lowercase-function-declaration.tsx @@ -1,12 +1,8 @@ -const $$splitErrorComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent, - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent, errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); function pendingComponent() { return
lowercase pending function declaration
; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options.tsx new file mode 100644 index 00000000000..af5cbf04e3d --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options.tsx @@ -0,0 +1,11 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const $$splitErrorComponentImporter = () => import("method-route-options.tsx?tsr-split=errorComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router'; +export const Route = createFileRoute('/method-options')({ loader() { + return state; +}, get component() { + return () =>
{state.count}
; +}, set component(_value) { + state.count++; +}, errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@component.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@errorComponent.tsx new file mode 100644 index 00000000000..8507dad015c --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@errorComponent.tsx @@ -0,0 +1,3 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const SplitErrorComponent = () =>
{state.count}
; +export { SplitErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@notFoundComponent.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@shared.tsx new file mode 100644 index 00000000000..d0eb5550fcf --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/method-route-options@shared.tsx @@ -0,0 +1,2 @@ +const state = { count: 0 }; +export { state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number.tsx index 0cb0a2e13bd..5c8326bbdb3 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number.tsx @@ -1,5 +1,5 @@ -const $$splitComponentImporter = () => import('random-number.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("random-number.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { Await, Link, createFileRoute, defer } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -15,18 +15,7 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; export const textColors = [`text-rose-500`, `text-yellow-500`, `text-teal-500`, `text-blue-500`]; export const gradients = [`from-rose-500 to-yellow-500`, `from-yellow-500 to-teal-500`, `from-teal-500 to-violet-500`, `from-blue-500 to-pink-500`]; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -export const Route = createFileRoute('/')({ - loader: () => { - return { - randomNumber: Math.random(), - sponsorsPromise: defer(getSponsorsForSponsorPack()) - }; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +export const Route = createFileRoute('/')({ loader: () => { + return { randomNumber: Math.random(), sponsorsPromise: defer(getSponsorsForSponsorPack()) }; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@component.tsx index 9ed6d15184a..38029bc0ef1 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@component.tsx @@ -1,3 +1,4 @@ +import { textColors, gradients, Route } from "random-number.tsx"; import { Await, Link } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -13,49 +14,22 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; import { useMutation } from '~/hooks/useMutation'; import { sample } from '~/utils/utils'; -import { textColors } from "random-number.tsx"; -import { gradients } from "random-number.tsx"; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -import { Route } from "random-number.tsx"; -async function bytesSignupServerFn({ - email -}: { +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +async function bytesSignupServerFn({ email }: { email: string; }) { 'use server'; - - return fetch(`https://bytes.dev/api/bytes-optin-cors`, { - method: 'POST', - body: JSON.stringify({ - email, - influencer: 'tanstack' - }), - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json' - } - }); + return fetch(`https://bytes.dev/api/bytes-optin-cors`, { method: 'POST', body: JSON.stringify({ email, influencer: 'tanstack' }), headers: { Accept: 'application/json', 'Content-Type': 'application/json' } }); } function Index() { - const bytesSignupMutation = useMutation({ - fn: bytesSignupServerFn - }); - const { - sponsorsPromise, - randomNumber, - testing2 - } = Route.useLoaderData(); + const bytesSignupMutation = useMutation({ fn: bytesSignupServerFn }); + const { sponsorsPromise, randomNumber, testing2 } = Route.useLoaderData(); const gradient = sample(gradients, randomNumber); const textColor = sample(textColors, randomNumber); - return <> + return (<> {discordImage} {gradient} {textColor} - ; + ); } export { Index as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@errorComponent.tsx index cdf4d378912..2d105853a45 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@errorComponent.tsx @@ -10,9 +10,4 @@ import agGridImage from '~/images/ag-grid.png'; import nozzleImage from '~/images/nozzle.png'; import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@notFoundComponent.tsx index cdf4d378912..2d105853a45 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/random-number@notFoundComponent.tsx @@ -10,9 +10,4 @@ import agGridImage from '~/images/ag-grid.png'; import nozzleImage from '~/images/nozzle.png'; import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-component.tsx index 5fd96f8da17..fa3d7c62f02 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-component.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('react-memo-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("react-memo-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedLoader } from '../../shared/imported'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: importedLoader -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: importedLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-imported-component.tsx index 69df0886db3..0f105f53404 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/react-memo-imported-component.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('react-memo-imported-component.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("react-memo-imported-component.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { importedLoader } from '../../shared/imported'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: importedLoader -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: importedLoader }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@component.tsx index a6d57afe77f..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@component.tsx @@ -1,2 +0,0 @@ -import { AboutComponent } from "retain-exports-destructured.tsx?tsr-shared=1"; -export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@shared.tsx index b03a4eb83a9..8ac31ee2fa6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-destructured@shared.tsx @@ -1,13 +1,5 @@ -const createBits = () => ({ - component: AboutComponentImpl, - loader: () => ({ - message: 'hello' - }) -}); -const { - component: AboutComponent, - loader -} = createBits(); +const createBits = () => ({ component: AboutComponentImpl, loader: () => ({ message: 'hello' }) }); +const { component: AboutComponent, loader } = createBits(); function AboutComponentImpl() { return
About
; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader.tsx index 88cd35f7040..a4872c8e87d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader.tsx @@ -1,16 +1,11 @@ -const $$splitComponentImporter = () => import('retain-exports-loader.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("retain-exports-loader.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; export function loaderFn() { - return { - foo: 'bar' - }; + return { foo: 'bar' }; } -export const Route = createFileRoute('/_layout')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: loaderFn -}); +export const Route = createFileRoute('/_layout')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: loaderFn }); export const SIDEBAR_WIDTH = '150px'; export const SIDEBAR_MINI_WIDTH = '80px'; const ASIDE_WIDTH = '250px'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader@component.tsx index 9f54ae0dc57..5b37e491605 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-loader@component.tsx @@ -2,10 +2,8 @@ import * as React from 'react'; import { Outlet } from '@tanstack/react-router'; import { importedComponent as ImportedComponent } from '../../shared/imported'; function Layout() { - return
-
+ return (
+
-
; +
); } const HEADER_HEIGHT = '63px'; const ASIDE_WIDTH = '250px'; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-class.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-class.tsx index 6e2f0229e42..281ba68b7c9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-class.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-class.tsx @@ -1,10 +1,7 @@ import { store } from "shared-class.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-class.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-class.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/store')({ - loader: async () => { - store.set('items', await fetch('/api')); - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/store')({ loader: async () => { + store.set('items', await fetch('/api')); +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export.tsx index 9453dbfbda1..6187c90fefc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export.tsx @@ -1,9 +1,6 @@ import { apiUrl } from "shared-destructured-export.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-destructured-export.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured-export.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/config')({ - loader: async () => fetch(apiUrl), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/config')({ loader: async () => fetch(apiUrl), component: lazyRouteComponent($$splitComponentImporter, "component") }); export { apiUrl, timeout } from "shared-destructured-export.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export@shared.tsx index f0bfd70add6..49e8606f291 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured-export@shared.tsx @@ -1,11 +1,5 @@ -const { - apiUrl, - timeout -} = getConfig(); +const { apiUrl, timeout } = getConfig(); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } export { apiUrl, getConfig, timeout }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured.tsx index 3019454516f..43a3b44b441 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured.tsx @@ -1,8 +1,5 @@ import { apiUrl } from "shared-destructured.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-destructured.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/config')({ - loader: async () => fetch(apiUrl), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/config')({ loader: async () => fetch(apiUrl), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured@shared.tsx index f0bfd70add6..49e8606f291 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-destructured@shared.tsx @@ -1,11 +1,5 @@ -const { - apiUrl, - timeout -} = getConfig(); +const { apiUrl, timeout } = getConfig(); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } export { apiUrl, getConfig, timeout }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported.tsx index c2eb8b1012a..229825322b6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported.tsx @@ -1,13 +1,8 @@ import { queryOptions } from "shared-exported.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-exported.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-exported.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/query')({ - loader: async () => { - return { - staleTime: queryOptions.staleTime - }; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/query')({ loader: async () => { + return { staleTime: queryOptions.staleTime }; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); export { queryOptions } from "shared-exported.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported@shared.tsx index a3f91b85bbb..5fda7eb61c6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-exported@shared.tsx @@ -1,5 +1,2 @@ -const queryOptions = { - staleTime: 5000, - gcTime: 10000 -}; +const queryOptions = { staleTime: 5000, gcTime: 10000 }; export { queryOptions }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-function.tsx index 7372ff4b071..584746079e6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-function.tsx @@ -1,14 +1,11 @@ import { getCached, cache } from "shared-function.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; function setCached(key: string, val: unknown) { cache.set(key, val); } -export const Route = createFileRoute('/cached')({ - loader: async () => { - setCached('data', await fetch('/api').then(r => r.json())); - return getCached('data'); - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/cached')({ loader: async () => { + setCached('data', await fetch('/api').then((r) => r.json())); + return getCached('data'); +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-imported-binding.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-imported-binding.tsx index c3e284c0816..8239babfeeb 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-imported-binding.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-imported-binding.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('shared-imported-binding.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-imported-binding.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; import { sharedUtil } from '../utils'; -export const Route = createFileRoute('/imported')({ - loader: async () => sharedUtil('load'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/imported')({ loader: async () => sharedUtil('load'), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref.tsx index 889dd57cf0f..312b99fec44 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref.tsx @@ -1,13 +1,8 @@ import { state, getCount } from "shared-indirect-ref.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-indirect-ref.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-indirect-ref.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/shared-indirect')({ - loader: () => { - state.count++; - return { - count: getCount() - }; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/shared-indirect')({ loader: () => { + state.count++; + return { count: getCount() }; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@component.tsx index 62995e7fd8f..dd8616407bd 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@component.tsx @@ -1,7 +1,7 @@ import { state, getCount } from "shared-indirect-ref.tsx?tsr-shared=1"; function SharedComponent() { - return
+ return (
{getCount()} - {state.count} -
; +
); } export { SharedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@shared.tsx index 7e7e811ba8b..0d83045cce7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-indirect-ref@shared.tsx @@ -1,6 +1,4 @@ -const state = { - count: 0 -}; +const state = { count: 0 }; function getCount() { return state.count; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref.tsx index 728caca361e..8c0c771ff72 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref.tsx @@ -1,9 +1,6 @@ import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-jsx-component-ref.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-jsx-component-ref.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; // @ts-nocheck import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/jsx')({ - loader: () => shared, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/jsx')({ loader: () => shared, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@component.tsx index 52ecb6d474b..58da2a6a554 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@component.tsx @@ -1,4 +1,4 @@ -import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; // @ts-nocheck +import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; function SharedComponent() { return
{shared}
; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@shared.tsx index d5cc2cf9903..c0fc2fa29ff 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-jsx-component-ref@shared.tsx @@ -1,4 +1,2 @@ -// @ts-nocheck - const shared = 1; export { shared }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none.tsx index dd352bfc41d..63249b84954 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('shared-none.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-none.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; const loaderHelper = () => fetch('/api'); -export const Route = createFileRoute('/clean')({ - loader: async () => loaderHelper(), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/clean')({ loader: async () => loaderHelper(), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none@component.tsx index 701deeedeb5..57514a490ca 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-none@component.tsx @@ -1,5 +1,5 @@ const ComponentHelper = () => helper; -const SplitComponent = () =>
+const SplitComponent = () => (
-
; +
); export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route.tsx index f82ac5b9000..df647470e8c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route.tsx @@ -1,16 +1,11 @@ import { HEADER } from "shared-referencing-route.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-referencing-route.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-referencing-route.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; function usePageTitle() { return `${HEADER} - ${Route.fullPath}`; } -export const Route = createFileRoute('/about')({ - loader: async () => { - const title = usePageTitle(); - return { - title - }; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ loader: async () => { + const title = usePageTitle(); + return { title }; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route@component.tsx index 2cb2cdb68cd..b47ff95c333 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-referencing-route@component.tsx @@ -1,8 +1,8 @@ import { HEADER } from "shared-referencing-route.tsx?tsr-shared=1"; +import { Route } from "shared-referencing-route.tsx"; function usePageTitle() { return `${HEADER} - ${Route.fullPath}`; } -import { Route } from "shared-referencing-route.tsx"; const SplitComponent = () => { const title = usePageTitle(); return
{title}
; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime.tsx index c230b4d37f8..55871f4528c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime.tsx @@ -1,23 +1,10 @@ -import { state, createState, createSeed, increment } from "shared-runtime.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-runtime.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +import { state, increment } from "shared-runtime.tsx?tsr-shared=1"; +const $$splitComponentImporter = () => import("shared-runtime.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('shared-runtime:reference'); -export const Route = createFileRoute('/shared-runtime')({ - beforeLoad: () => state, - loader: () => { - increment(); - return state; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; \ No newline at end of file +export const Route = createFileRoute('/shared-runtime')({ beforeLoad: () => state, loader: () => { + increment(); + return state; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); +export { createSeed as default, state as firstState, state as secondState, state as "odd-name" } from "shared-runtime.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@component.tsx index fbccf6c90bc..e753ef75b2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@component.tsx @@ -1,19 +1,9 @@ -import { state, createState, createSeed, Labels } from "shared-runtime.tsx?tsr-shared=1"; +import { state, Labels } from "shared-runtime.tsx?tsr-shared=1"; const label = createComponentLabel(); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; function createComponentLabel() { console.log('shared-runtime:component'); return Labels.component; } -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; const SplitComponent = () => { if (state.count === 3) { throw new Error('route source-map contract'); diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@shared.tsx index 54239b6cc59..5b947f61be2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-runtime@shared.tsx @@ -1,28 +1,27 @@ -const Count = { - Initial: 0 -}; -const Labels = { - component: 'count' -}; +enum Count { + Initial = 0 +} +namespace Labels { + export const component = 'count'; +} const seed = createSeed(); -const { - state, - increment -} = createState(seed); +const { state, increment } = createState(seed); function createSeed() { console.log('shared-runtime:seed'); - return { - count: Count.Initial, - label: Labels.component - }; + return { count: Count.Initial, label: Labels.component }; } +function createState(initialState: { + count: number; +}): { + state: { + count: number; + }; + increment: () => number; +}; function createState(initialState: { count: number; }) { console.log('shared-runtime:state'); - return { - state: initialState, - increment: () => initialState.count++ - }; + return { state: initialState, increment: () => initialState.count++ }; } -export { Count, createSeed, createState, increment, Labels, seed, state }; \ No newline at end of file +export { Count, Labels, createSeed, createState, increment, seed, state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive.tsx index ce5a10c47cd..94bcd65f8d8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive.tsx @@ -1,11 +1,8 @@ import { config } from "shared-transitive.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-transitive.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-transitive.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; const fetcher = (path: string) => fetch(`${config.url}${path}`); -export const Route = createFileRoute('/api')({ - loader: async () => { - return fetcher('/data'); - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/api')({ loader: async () => { + return fetcher('/data'); +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive@shared.tsx index 8bec4a1d55b..7aaff94236d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-transitive@shared.tsx @@ -1,6 +1,3 @@ const BASE_URL = 'https://api.example.com'; -const config = { - url: BASE_URL, - timeout: 5000 -}; +const config = { url: BASE_URL, timeout: 5000 }; export { BASE_URL, config }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable.tsx index c0c02cec46e..64cc2f2b585 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable.tsx @@ -1,13 +1,8 @@ import { collection } from "shared-variable.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-variable.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-variable.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/todos')({ - loader: async () => { - await collection.preload(); - return { - data: 'loaded' - }; - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/todos')({ loader: async () => { + await collection.preload(); + return { data: 'loaded' }; +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable@shared.tsx index 8a0560d5b94..48e97638b30 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-variable@shared.tsx @@ -1,5 +1,2 @@ -const collection = { - name: 'todos', - preload: async () => {} -}; +const collection = { name: 'todos', preload: async () => {} }; export { collection }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-with-side-effect.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-with-side-effect.tsx index cba0c7770bc..23355ae10a1 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-with-side-effect.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/shared-with-side-effect.tsx @@ -1,11 +1,8 @@ import { registry } from "shared-with-side-effect.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-with-side-effect.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-with-side-effect.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('registry created'); -export const Route = createFileRoute('/fx')({ - loader: async () => { - registry.set('loaded', true); - }, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/fx')({ loader: async () => { + registry.set('loaded', true); +}, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function.tsx index ad713472225..018777df8ac 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('arrow-function.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("arrow-function.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx index 7fe3edee112..d5f6a179ae7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,27 +1,20 @@ +import { Route } from "arrow-function.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@loader.tsx index cb195afdd88..7ba1227b6be 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/arrow-function@loader.tsx @@ -1,4 +1,3 @@ import * as React from 'react'; import { fetchPosts } from '../posts'; -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; \ No newline at end of file +export { fetchPosts as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals.tsx index c31ee0e0952..b662507926f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals.tsx @@ -1,13 +1,7 @@ -const $$splitLoaderImporter = () => import('boolean-null-literals.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('boolean-null-literals.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("boolean-null-literals.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("boolean-null-literals.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/router'; - // Test errorComponent with false literal -export const Route = createFileRoute('/test')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: false, - pendingComponent: null, - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/test')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: false, pendingComponent: null, loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@component---errorComponent---notFoundComponent---pendingComponent.tsx index c49c9e93a31..8d69627049a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ -// Test errorComponent with false literal const SplitComponent = () =>
Test Component
; export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@loader.tsx index 666ed1e7eca..b25c2d3238e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/boolean-null-literals@loader.tsx @@ -1,5 +1,2 @@ -// Test errorComponent with false literal -const SplitLoader = async () => ({ - data: 'test' -}); +const SplitLoader = async () => ({ data: 'test' }); export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese.tsx index 327e227da42..022ff52261b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese.tsx @@ -1,10 +1,8 @@ -const $$splitComponentImporter = () => import('chinese.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("chinese.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); interface DemoProps { title: string; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese@component---errorComponent---notFoundComponent---pendingComponent.tsx index 003ca944a17..00cdecb00f0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/chinese@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,23 +1,16 @@ import * as React from 'react'; function HomeComponent() { - return
+ return (
-
; +
); } interface DemoProps { title: string; } -function Demo({ - title -}: DemoProps) { - return

+function Demo({ title }: DemoProps) { + return (

{title} -

; + ); } export { HomeComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function.tsx index ec4cff827de..7a93cad0584 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx index 39ace71ebea..956d9ca51b9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } const App = () => { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); }; function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function.tsx index e4a82d1022b..654e3eb900c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function@component---errorComponent---notFoundComponent---pendingComponent.tsx index 96a753ad8a6..3a38522bce8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/circular-reference-function@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } function App() { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); } function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/conditional-properties.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/conditional-properties.tsx index c20dcdc1354..53f0c3ed2a5 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/conditional-properties.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/conditional-properties.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('conditional-properties.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('conditional-properties.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("conditional-properties.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("conditional-properties.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple.tsx index e411fd54d87..2e81647105d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple.tsx @@ -1,15 +1,7 @@ -const $$splitComponentImporter = () => import('destructured-export-multiple.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-multiple.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const getConfig = () => ({ - baseUrl: 'https://api.example.com', - timeout: 5000 -}); -export const { - baseUrl, - timeout -} = getConfig(); +export const getConfig = () => ({ baseUrl: 'https://api.example.com', timeout: 5000 }); +export const { baseUrl, timeout } = getConfig(); export const [first, second] = [1, 2]; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple@component---errorComponent---notFoundComponent---pendingComponent.tsx index 9441b5a6893..760ed079749 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-multiple@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,8 +1,8 @@ import { baseUrl, timeout } from "destructured-export-multiple.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

Timeout: {timeout}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested.tsx index 076c24b06fc..b3b4a7fd932 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested.tsx @@ -1,19 +1,6 @@ -const $$splitComponentImporter = () => import('destructured-export-nested.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-nested.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -const getConfig = () => ({ - api: { - baseUrl: 'https://api.example.com' - }, - timeout: 5000, - extra: 'data' -}); -export const { - api: { - baseUrl - }, - ...rest -} = getConfig(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const getConfig = () => ({ api: { baseUrl: 'https://api.example.com' }, timeout: 5000, extra: 'data' }); +export const { api: { baseUrl }, ...rest } = getConfig(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested@component---errorComponent---notFoundComponent---pendingComponent.tsx index 8ba46e33e13..a25215497c2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export-nested@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,7 +1,7 @@ import { baseUrl } from "destructured-export-nested.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export.tsx index 3f79ca544be..67733178798 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export.tsx @@ -1,17 +1,8 @@ -const $$splitComponentImporter = () => import('destructured-export.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; + return { getObject: () => ({ constA: 10, constB: 5 }) }; } -export const { - getObject -} = getObjectCallback(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const { getObject } = getObjectCallback(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@component---errorComponent---notFoundComponent---pendingComponent.tsx index f58942d5afc..63047f4c051 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,14 +1,6 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} function AboutComponent() { - return
+ return (

About

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@loader.tsx index 45fb19eecd8..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-export@loader.tsx @@ -1,8 +0,0 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component.tsx index c27220acce3..94d70b98887 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('destructured-react-memo-imported-component.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('destructured-react-memo-imported-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("destructured-react-memo-imported-component.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("destructured-react-memo-imported-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component@loader.tsx index 52e811be532..46a8289453e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-react-memo-imported-component@loader.tsx @@ -1,3 +1,2 @@ import { importedLoader } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults.tsx index 1759b05846d..12b1a1310c2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('destructured-route-options-defaults.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('destructured-route-options-defaults.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("destructured-route-options-defaults.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("destructured-route-options-defaults.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults@shared.tsx index fdc9acef5bb..ca395ad4c38 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructured-route-options-defaults@shared.tsx @@ -1,22 +1,12 @@ function defaultLoader() { - return { - message: 'default' - }; + return { message: 'default' }; } function DefaultComponent() { return
Default
; } -const createBits = () => ({ - component: ActualComponent, - loader: () => ({ - message: 'hello' - }) -}); -const { - component: MyComponent = DefaultComponent, - loader = defaultLoader -} = createBits(); +const createBits = () => ({ component: ActualComponent, loader: () => ({ message: 'hello' }) }); +const { component: MyComponent = DefaultComponent, loader = defaultLoader } = createBits(); function ActualComponent() { return
About
; } -export { ActualComponent, createBits, DefaultComponent, defaultLoader, loader, MyComponent }; \ No newline at end of file +export { ActualComponent, DefaultComponent, MyComponent, createBits, defaultLoader, loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@component---errorComponent---notFoundComponent---pendingComponent.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@loader.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring@loader.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue.tsx index 12d3529331c..f8507d19619 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue.tsx @@ -1,8 +1,5 @@ 'use client'; - -const $$splitComponentImporter = () => import('directive-prologue.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("directive-prologue.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/directive')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/directive')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue@component---errorComponent---notFoundComponent---pendingComponent.tsx index ce7cd5e5ee1..d99c313cdd9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/directive-prologue@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,4 @@ 'use client'; - const SplitComponent = () => { return
directive preserved
; }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component-and-normal-notFound.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component-and-normal-notFound.tsx index 0ca25a70177..bfeecaad287 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component-and-normal-notFound.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component-and-normal-notFound.tsx @@ -1,15 +1,12 @@ console.warn("[tanstack-router] These exports from \"export-default-component-and-normal-notFound.tsx\" will not be code-split and will increase your bundle size:\n- Home\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitNotFoundComponentImporter = () => import('export-default-component-and-normal-notFound.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("export-default-component-and-normal-notFound.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import React, { useState } from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/home')({ - component: Home, - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); +export const Route = createFileRoute('/home')({ component: Home, notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); export default function Home() { const [one, setOne] = useState('this is from a state'); - return
+ return (

{one}

-
; +
); } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration.tsx index c191f9fddd8..e6fda38e533 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('function-declaration.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("function-declaration.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@component---errorComponent---notFoundComponent---pendingComponent.tsx index 3476c52d544..b50aa2a7c66 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,27 +1,20 @@ +import { Route } from "function-declaration.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; -import { Route } from "function-declaration.tsx"; function PostsComponent() { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); } export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@loader.tsx index cb195afdd88..7ba1227b6be 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-declaration@loader.tsx @@ -1,4 +1,3 @@ import * as React from 'react'; import { fetchPosts } from '../posts'; -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; \ No newline at end of file +export { fetchPosts as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/importAttribute.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/importAttribute.tsx index e2aab465f59..2afe8cf58bc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/importAttribute.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/importAttribute.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('importAttribute.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("importAttribute.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader.tsx index 70d5be8c3f6..52fda8a664f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('imported-default-component-destructured-loader.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('imported-default-component-destructured-loader.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("imported-default-component-destructured-loader.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("imported-default-component-destructured-loader.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx index d21b198c985..25df3bb3542 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ import importedComponent from '../../shared/imported'; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@loader.tsx index 52e811be532..46a8289453e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component-destructured-loader@loader.tsx @@ -1,3 +1,2 @@ import { importedLoader } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component.tsx index 601c1f656a5..baa45f5f645 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('imported-default-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported-default-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component@component---errorComponent---notFoundComponent---pendingComponent.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-default-component@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent.tsx index 4df12c02de6..58232ff5319 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent.tsx @@ -1,8 +1,5 @@ -const $$splitErrorComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx index d8a0fcf9ff7..54a21008a63 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-errorComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import ImportedDefaultComponent, { importedErrorComponent } from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; -const SplitErrorComponent = importedErrorComponent; -export { SplitErrorComponent as errorComponent }; \ No newline at end of file +export { ImportedDefaultComponent as component }; +export { importedErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent.tsx index 716ec0ca3aa..2abd24ae4d0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent.tsx @@ -1,8 +1,5 @@ -const $$splitNotFoundComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx index 1273c7c50d5..a16abed4002 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-notFoundComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import ImportedDefaultComponent, { importedNotFoundComponent } from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; -const SplitNotFoundComponent = importedNotFoundComponent; -export { SplitNotFoundComponent as notFoundComponent }; \ No newline at end of file +export { ImportedDefaultComponent as component }; +export { importedNotFoundComponent as notFoundComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent.tsx index 5a5aa789f7f..85607db1b56 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent.tsx @@ -1,8 +1,5 @@ -const $$splitPendingComponentImporter = () => import('imported-pendingComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('imported-pendingComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitPendingComponentImporter = () => import("imported-pendingComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("imported-pendingComponent.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, 'pendingComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, "pendingComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx index 0368000afae..4b2e5b2a0c4 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported-pendingComponent@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import ImportedDefaultComponent, { importedPendingComponent } from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; -const SplitPendingComponent = importedPendingComponent; -export { SplitPendingComponent as pendingComponent }; \ No newline at end of file +export { ImportedDefaultComponent as component }; +export { importedPendingComponent as pendingComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported.tsx index dd3299b1b19..19e7ec76558 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('imported.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('imported.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("imported.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("imported.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@component---errorComponent---notFoundComponent---pendingComponent.tsx index 5bc9da8d43b..03c69c46e37 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ import { importedComponent } from '../../shared'; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@loader.tsx index 9b91fafd916..35cb9d1061d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/imported@loader.tsx @@ -1,3 +1,2 @@ import { importedLoader } from '../../shared'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline.tsx index 960f639c0a2..cc95547cfc8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline.tsx @@ -1,9 +1,7 @@ -const $$splitComponentImporter = () => import('inline.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("inline.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); Route.addChildren([]); export const test = 'test'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@component---errorComponent---notFoundComponent---pendingComponent.tsx index 58ccfb29032..da91d03e3d0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,4 @@ +import { Route, test } from "inline.tsx"; import * as React from 'react'; import * as styles from '../style.css'; import { TEST_DATA } from '../test.const'; @@ -6,13 +7,11 @@ const Button = (props: { }) => { return ; }; -import { Route } from "inline.tsx"; -import { test } from "inline.tsx"; const SplitComponent = () => { - return
+ return (
{test}

{TEST_DATA.welcome}

-
; +
); }; export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@loader.tsx index 9236af60214..bd863dd8f99 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline@loader.tsx @@ -1,2 +1,2 @@ -import * as React from 'react'; -import { Route } from "inline.tsx"; \ No newline at end of file +import { Route } from "inline.tsx"; +import * as React from 'react'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/lowercase-function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/lowercase-function-declaration.tsx index 75657cb44a7..515ead2ef33 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/lowercase-function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/lowercase-function-declaration.tsx @@ -1,10 +1,6 @@ -const $$splitErrorComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -const $$splitPendingComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +const $$splitPendingComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, 'pendingComponent'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, "pendingComponent"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options.tsx new file mode 100644 index 00000000000..20eb1d873f1 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options.tsx @@ -0,0 +1,11 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const $$splitErrorComponentImporter = () => import("method-route-options.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router'; +export const Route = createFileRoute('/method-options')({ loader() { + return state; +}, get component() { + return () =>
{state.count}
; +}, set component(_value) { + state.count++; +}, errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@component---errorComponent---notFoundComponent---pendingComponent.tsx new file mode 100644 index 00000000000..8507dad015c --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -0,0 +1,3 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const SplitErrorComponent = () =>
{state.count}
; +export { SplitErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@loader.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@shared.tsx new file mode 100644 index 00000000000..d0eb5550fcf --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/method-route-options@shared.tsx @@ -0,0 +1,2 @@ +const state = { count: 0 }; +export { state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number.tsx index a345d17ae75..b01001f67e7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number.tsx @@ -1,7 +1,7 @@ -const $$splitComponentImporter = () => import('random-number.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('random-number.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("random-number.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("random-number.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { Await, Link, createFileRoute } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -16,13 +16,5 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; export const textColors = [`text-rose-500`, `text-yellow-500`, `text-teal-500`, `text-blue-500`]; export const gradients = [`from-rose-500 to-yellow-500`, `from-yellow-500 to-teal-500`, `from-teal-500 to-violet-500`, `from-blue-500 to-pink-500`]; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -export const Route = createFileRoute('/')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +export const Route = createFileRoute('/')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@component---errorComponent---notFoundComponent---pendingComponent.tsx index 9ed6d15184a..38029bc0ef1 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,4 @@ +import { textColors, gradients, Route } from "random-number.tsx"; import { Await, Link } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -13,49 +14,22 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; import { useMutation } from '~/hooks/useMutation'; import { sample } from '~/utils/utils'; -import { textColors } from "random-number.tsx"; -import { gradients } from "random-number.tsx"; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -import { Route } from "random-number.tsx"; -async function bytesSignupServerFn({ - email -}: { +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +async function bytesSignupServerFn({ email }: { email: string; }) { 'use server'; - - return fetch(`https://bytes.dev/api/bytes-optin-cors`, { - method: 'POST', - body: JSON.stringify({ - email, - influencer: 'tanstack' - }), - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json' - } - }); + return fetch(`https://bytes.dev/api/bytes-optin-cors`, { method: 'POST', body: JSON.stringify({ email, influencer: 'tanstack' }), headers: { Accept: 'application/json', 'Content-Type': 'application/json' } }); } function Index() { - const bytesSignupMutation = useMutation({ - fn: bytesSignupServerFn - }); - const { - sponsorsPromise, - randomNumber, - testing2 - } = Route.useLoaderData(); + const bytesSignupMutation = useMutation({ fn: bytesSignupServerFn }); + const { sponsorsPromise, randomNumber, testing2 } = Route.useLoaderData(); const gradient = sample(gradients, randomNumber); const textColor = sample(textColors, randomNumber); - return <> + return (<> {discordImage} {gradient} {textColor} - ; + ); } export { Index as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@loader.tsx index 9f854acfb07..a9d1239b08a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/random-number@loader.tsx @@ -11,16 +11,8 @@ import agGridImage from '~/images/ag-grid.png'; import nozzleImage from '~/images/nozzle.png'; import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; const SplitLoader = () => { - return { - randomNumber: Math.random(), - sponsorsPromise: defer(getSponsorsForSponsorPack()) - }; + return { randomNumber: Math.random(), sponsorsPromise: defer(getSponsorsForSponsorPack()) }; }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component.tsx index eea3e629960..74b348b486a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('react-memo-component.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('react-memo-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("react-memo-component.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("react-memo-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component@loader.tsx index 52e811be532..46a8289453e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-component@loader.tsx @@ -1,3 +1,2 @@ import { importedLoader } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component.tsx index e445bcbb725..301a5c1a27e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('react-memo-imported-component.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('react-memo-imported-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("react-memo-imported-component.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("react-memo-imported-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component@loader.tsx index 52e811be532..46a8289453e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/react-memo-imported-component@loader.tsx @@ -1,3 +1,2 @@ import { importedLoader } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component.tsx index f22aa236e1d..96d02cc5034 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component.tsx @@ -1,14 +1,12 @@ console.warn("[tanstack-router] These exports from \"retain-export-component.tsx\" will not be code-split and will increase your bundle size:\n- Layout\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitLoaderImporter = () => import('retain-export-component.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("retain-export-component.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute, Outlet } from '@tanstack/react-router'; import { importedComponent as ImportedComponent } from '../../shared/imported'; export function Layout() { - return
-
+ return (
+
-
; +
); } -export const Route = createFileRoute('/_layout')({ - component: Layout, - loader: lazyFn($$splitLoaderImporter, 'loader') -}); +export const Route = createFileRoute('/_layout')({ component: Layout, loader: lazyFn($$splitLoaderImporter, "loader") }); const HEADER_HEIGHT = '63px'; export const SIDEBAR_WIDTH = '150px'; const SIDEBAR_MINI_WIDTH = '80px'; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component@loader.tsx index 9787e27ad7f..5faf3e93fc1 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-export-component@loader.tsx @@ -2,5 +2,4 @@ import * as React from 'react'; import { importedLoader } from '../../shared/imported'; const SIDEBAR_MINI_WIDTH = '80px'; const ASIDE_WIDTH = '250px'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@component---errorComponent---notFoundComponent---pendingComponent.tsx index a6d57afe77f..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,2 +0,0 @@ -import { AboutComponent } from "retain-exports-destructured.tsx?tsr-shared=1"; -export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@loader.tsx index e8d771ea443..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@loader.tsx @@ -1,2 +0,0 @@ -import { loader } from "retain-exports-destructured.tsx?tsr-shared=1"; -export { loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@shared.tsx index b03a4eb83a9..8ac31ee2fa6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-destructured@shared.tsx @@ -1,13 +1,5 @@ -const createBits = () => ({ - component: AboutComponentImpl, - loader: () => ({ - message: 'hello' - }) -}); -const { - component: AboutComponent, - loader -} = createBits(); +const createBits = () => ({ component: AboutComponentImpl, loader: () => ({ message: 'hello' }) }); +const { component: AboutComponent, loader } = createBits(); function AboutComponentImpl() { return
About
; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader.tsx index c7d54377291..86576377c5f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader.tsx @@ -1,17 +1,12 @@ console.warn("[tanstack-router] These exports from \"retain-exports-loader.tsx\" will not be code-split and will increase your bundle size:\n- loaderFn\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitComponentImporter = () => import('retain-exports-loader.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("retain-exports-loader.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; export function loaderFn() { - return { - foo: 'bar' - }; + return { foo: 'bar' }; } -export const Route = createFileRoute('/_layout')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: loaderFn -}); +export const Route = createFileRoute('/_layout')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: loaderFn }); export const SIDEBAR_WIDTH = '150px'; export const SIDEBAR_MINI_WIDTH = '80px'; const ASIDE_WIDTH = '250px'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx index 9f54ae0dc57..5b37e491605 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -2,10 +2,8 @@ import * as React from 'react'; import { Outlet } from '@tanstack/react-router'; import { importedComponent as ImportedComponent } from '../../shared/imported'; function Layout() { - return
-
+ return (
+
-
; +
); } const HEADER_HEIGHT = '63px'; const ASIDE_WIDTH = '250px'; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-class.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-class.tsx index da068daa177..8c30132b06e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-class.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-class.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-class.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-class.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-class.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-class.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/store')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/store')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export.tsx index 7d0f0fcae1e..6cd405d8a0b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-destructured-export.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-destructured-export.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured-export.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-destructured-export.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/config')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/config')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); export { apiUrl, timeout } from "shared-destructured-export.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export@shared.tsx index f0bfd70add6..49e8606f291 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured-export@shared.tsx @@ -1,11 +1,5 @@ -const { - apiUrl, - timeout -} = getConfig(); +const { apiUrl, timeout } = getConfig(); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } export { apiUrl, getConfig, timeout }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured.tsx index 8185738e9d2..864378f0e11 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-destructured.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-destructured.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-destructured.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/config')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/config')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured@shared.tsx index f0bfd70add6..49e8606f291 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-destructured@shared.tsx @@ -1,11 +1,5 @@ -const { - apiUrl, - timeout -} = getConfig(); +const { apiUrl, timeout } = getConfig(); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } export { apiUrl, getConfig, timeout }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported.tsx index ce690311b22..623220d1565 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-exported.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-exported.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-exported.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-exported.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/query')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/query')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); export { queryOptions } from "shared-exported.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@loader.tsx index 332fa350795..f912a2a9a4d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@loader.tsx @@ -1,7 +1,5 @@ import { queryOptions } from "shared-exported.tsx?tsr-shared=1"; const SplitLoader = async () => { - return { - staleTime: queryOptions.staleTime - }; + return { staleTime: queryOptions.staleTime }; }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@shared.tsx index a3f91b85bbb..5fda7eb61c6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-exported@shared.tsx @@ -1,5 +1,2 @@ -const queryOptions = { - staleTime: 5000, - gcTime: 10000 -}; +const queryOptions = { staleTime: 5000, gcTime: 10000 }; export { queryOptions }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function.tsx index b5bf41235e1..8260f13a8e0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-function.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-function.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/cached')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/cached')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function@loader.tsx index f5f72ab0145..7b140f3a558 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-function@loader.tsx @@ -3,7 +3,7 @@ function setCached(key: string, val: unknown) { cache.set(key, val); } const SplitLoader = async () => { - setCached('data', await fetch('/api').then(r => r.json())); + setCached('data', await fetch('/api').then((r) => r.json())); return getCached('data'); }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-imported-binding.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-imported-binding.tsx index d9ce6828fab..7fc7ba1476f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-imported-binding.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-imported-binding.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-imported-binding.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-imported-binding.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-imported-binding.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-imported-binding.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/imported')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/imported')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref.tsx index f4dfce52bab..c54228c7c82 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-indirect-ref.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-indirect-ref.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-indirect-ref.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-indirect-ref.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/shared-indirect')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/shared-indirect')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx index 62995e7fd8f..dd8616407bd 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,7 +1,7 @@ import { state, getCount } from "shared-indirect-ref.tsx?tsr-shared=1"; function SharedComponent() { - return
+ return (
{getCount()} - {state.count} -
; +
); } export { SharedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@loader.tsx index 0625ac53f83..c402bad282c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@loader.tsx @@ -1,8 +1,6 @@ import { state, getCount } from "shared-indirect-ref.tsx?tsr-shared=1"; const SplitLoader = () => { state.count++; - return { - count: getCount() - }; + return { count: getCount() }; }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@shared.tsx index 7e7e811ba8b..0d83045cce7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-indirect-ref@shared.tsx @@ -1,6 +1,4 @@ -const state = { - count: 0 -}; +const state = { count: 0 }; function getCount() { return state.count; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref.tsx index 8ac24d49cf4..32f24267d03 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-jsx-component-ref.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-jsx-component-ref.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-jsx-component-ref.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-jsx-component-ref.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; // @ts-nocheck import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/jsx')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/jsx')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx index 52ecb6d474b..58da2a6a554 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,4 +1,4 @@ -import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; // @ts-nocheck +import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; function SharedComponent() { return
{shared}
; } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@loader.tsx index f861dda4364..86e244aad6e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@loader.tsx @@ -1,3 +1,3 @@ -import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; // @ts-nocheck +import { shared } from "shared-jsx-component-ref.tsx?tsr-shared=1"; const SplitLoader = () => shared; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@shared.tsx index d5cc2cf9903..c0fc2fa29ff 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-jsx-component-ref@shared.tsx @@ -1,4 +1,2 @@ -// @ts-nocheck - const shared = 1; export { shared }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none.tsx index 06e81042d6d..1b2c320f3c7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-none.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-none.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-none.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-none.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/clean')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/clean')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none@component---errorComponent---notFoundComponent---pendingComponent.tsx index 701deeedeb5..57514a490ca 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-none@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,5 @@ const ComponentHelper = () => helper; -const SplitComponent = () =>
+const SplitComponent = () => (
-
; +
); export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route.tsx index b62568c1fbb..34eaa6ea626 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-referencing-route.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-referencing-route.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-referencing-route.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-referencing-route.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/about')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@component---errorComponent---notFoundComponent---pendingComponent.tsx index 2cb2cdb68cd..b47ff95c333 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,8 +1,8 @@ import { HEADER } from "shared-referencing-route.tsx?tsr-shared=1"; +import { Route } from "shared-referencing-route.tsx"; function usePageTitle() { return `${HEADER} - ${Route.fullPath}`; } -import { Route } from "shared-referencing-route.tsx"; const SplitComponent = () => { const title = usePageTitle(); return
{title}
; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@loader.tsx index baedd53bd78..45cfbd3aa43 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-referencing-route@loader.tsx @@ -1,12 +1,10 @@ import { HEADER } from "shared-referencing-route.tsx?tsr-shared=1"; +import { Route } from "shared-referencing-route.tsx"; function usePageTitle() { return `${HEADER} - ${Route.fullPath}`; } -import { Route } from "shared-referencing-route.tsx"; const SplitLoader = async () => { const title = usePageTitle(); - return { - title - }; + return { title }; }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime.tsx index bceb12d39a4..6b30146ba13 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime.tsx @@ -1,22 +1,9 @@ -import { state, createState, createSeed } from "shared-runtime.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-runtime.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-runtime.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +import { state } from "shared-runtime.tsx?tsr-shared=1"; +const $$splitComponentImporter = () => import("shared-runtime.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-runtime.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('shared-runtime:reference'); -export const Route = createFileRoute('/shared-runtime')({ - beforeLoad: () => state, - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; \ No newline at end of file +export const Route = createFileRoute('/shared-runtime')({ beforeLoad: () => state, loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); +export { createSeed as default, state as firstState, state as secondState, state as "odd-name" } from "shared-runtime.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@component---errorComponent---notFoundComponent---pendingComponent.tsx index fbccf6c90bc..e753ef75b2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,19 +1,9 @@ -import { state, createState, createSeed, Labels } from "shared-runtime.tsx?tsr-shared=1"; +import { state, Labels } from "shared-runtime.tsx?tsr-shared=1"; const label = createComponentLabel(); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; function createComponentLabel() { console.log('shared-runtime:component'); return Labels.component; } -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; const SplitComponent = () => { if (state.count === 3) { throw new Error('route source-map contract'); diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@loader.tsx index 6c797c0226f..9e9958cbae2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@loader.tsx @@ -1,14 +1,4 @@ -import { state, createState, createSeed, increment } from "shared-runtime.tsx?tsr-shared=1"; -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; +import { state, increment } from "shared-runtime.tsx?tsr-shared=1"; const SplitLoader = () => { increment(); return state; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@shared.tsx index 54239b6cc59..5b947f61be2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-runtime@shared.tsx @@ -1,28 +1,27 @@ -const Count = { - Initial: 0 -}; -const Labels = { - component: 'count' -}; +enum Count { + Initial = 0 +} +namespace Labels { + export const component = 'count'; +} const seed = createSeed(); -const { - state, - increment -} = createState(seed); +const { state, increment } = createState(seed); function createSeed() { console.log('shared-runtime:seed'); - return { - count: Count.Initial, - label: Labels.component - }; + return { count: Count.Initial, label: Labels.component }; } +function createState(initialState: { + count: number; +}): { + state: { + count: number; + }; + increment: () => number; +}; function createState(initialState: { count: number; }) { console.log('shared-runtime:state'); - return { - state: initialState, - increment: () => initialState.count++ - }; + return { state: initialState, increment: () => initialState.count++ }; } -export { Count, createSeed, createState, increment, Labels, seed, state }; \ No newline at end of file +export { Count, Labels, createSeed, createState, increment, seed, state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive.tsx index 869602e15b6..12d2e88e280 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-transitive.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-transitive.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-transitive.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-transitive.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/api')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/api')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive@shared.tsx index 8bec4a1d55b..7aaff94236d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-transitive@shared.tsx @@ -1,6 +1,3 @@ const BASE_URL = 'https://api.example.com'; -const config = { - url: BASE_URL, - timeout: 5000 -}; +const config = { url: BASE_URL, timeout: 5000 }; export { BASE_URL, config }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable.tsx index 42f68cce485..bb0e8ed37fc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-variable.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-variable.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-variable.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-variable.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/todos')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/todos')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@loader.tsx index 196a8e48a46..40db931fe28 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@loader.tsx @@ -1,8 +1,6 @@ import { collection } from "shared-variable.tsx?tsr-shared=1"; const SplitLoader = async () => { await collection.preload(); - return { - data: 'loaded' - }; + return { data: 'loaded' }; }; export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@shared.tsx index 8a0560d5b94..48e97638b30 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-variable@shared.tsx @@ -1,5 +1,2 @@ -const collection = { - name: 'todos', - preload: async () => {} -}; +const collection = { name: 'todos', preload: async () => {} }; export { collection }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-with-side-effect.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-with-side-effect.tsx index 943cdf189ca..ae3862f4853 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-with-side-effect.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/shared-with-side-effect.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-with-side-effect.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-with-side-effect.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-with-side-effect.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-with-side-effect.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('registry created'); -export const Route = createFileRoute('/fx')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/fx')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using.tsx index c58f0f663bf..c3903eff601 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using.tsx @@ -1,5 +1,3 @@ -const $$splitLoaderImporter = () => import('using.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/react-router'; -export const Route = createFileRoute({ - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +const $$splitLoaderImporter = () => import("using.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/react-router"; +export const Route = createFileRoute({ loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using@loader.tsx index 7e4f4fde9b9..54d6fced97b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/using@loader.tsx @@ -1,16 +1,5 @@ -const DummyPostResource = (postId: string) => ({ - postData: { - id: postId, - title: 'dummy', - body: 'dummy' - }, - [Symbol.dispose]: () => console.log('disposing!') -}); -const SplitLoader = ({ - params: { - postId - } -}) => { +const DummyPostResource = (postId: string) => ({ postData: { id: postId, title: 'dummy', body: 'dummy' }, [Symbol.dispose]: () => console.log('disposing!') }); +const SplitLoader = ({ params: { postId } }) => { using dummyPost = DummyPostResource(postId); return dummyPost.postData; }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function.tsx index 380087d43cd..929196bfadc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx index 764043a59c6..974ce938d9f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,30 +1,22 @@ +import { Route } from "arrow-function.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); }; -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; +export { fetchPosts as loader }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals.tsx index d3f54dd789e..468b0f083c7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals.tsx @@ -1,13 +1,7 @@ -const $$splitLoaderImporter = () => import('boolean-null-literals.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('boolean-null-literals.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("boolean-null-literals.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("boolean-null-literals.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/router'; - // Test errorComponent with false literal -export const Route = createFileRoute('/test')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: false, - pendingComponent: null, - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/test')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: false, pendingComponent: null, loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals@component---loader---notFoundComponent---pendingComponent.tsx index 40973b03281..69182130300 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/boolean-null-literals@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,7 +1,4 @@ -// Test errorComponent with false literal -const SplitLoader = async () => ({ - data: 'test' -}); -export { SplitLoader as loader }; const SplitComponent = () =>
Test Component
; -export { SplitComponent as component }; \ No newline at end of file +export { SplitComponent as component }; +const SplitLoader = async () => ({ data: 'test' }); +export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese.tsx index d08045e2388..d7f9333e2b7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese.tsx @@ -1,10 +1,8 @@ -const $$splitComponentImporter = () => import('chinese.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("chinese.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); interface DemoProps { title: string; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese@component---loader---notFoundComponent---pendingComponent.tsx index 003ca944a17..00cdecb00f0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/chinese@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,23 +1,16 @@ import * as React from 'react'; function HomeComponent() { - return
+ return (
-
; +
); } interface DemoProps { title: string; } -function Demo({ - title -}: DemoProps) { - return

+function Demo({ title }: DemoProps) { + return (

{title} -

; + ); } export { HomeComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function.tsx index fe221be9649..b30d88712ec 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function@component---loader---notFoundComponent---pendingComponent.tsx index 39ace71ebea..956d9ca51b9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-arrow-function@component---loader---notFoundComponent---pendingComponent.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } const App = () => { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); }; function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function.tsx index 14d74d432d2..fa8e827eab6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('circular-reference-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("circular-reference-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function@component---loader---notFoundComponent---pendingComponent.tsx index 96a753ad8a6..3a38522bce8 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/circular-reference-function@component---loader---notFoundComponent---pendingComponent.tsx @@ -2,18 +2,14 @@ function getComponentName(obj: Record): string { return Object.keys(obj)[0]; } function App() { - const componentName = getComponentName({ - App - }); - return
+ const componentName = getComponentName({ App }); + return (
Component Name is {componentName} -
; +
); } function OtherComponent() { - const componentName = getComponentName({ - App - }); + const componentName = getComponentName({ App }); return
App component name is {componentName}
; } export { App as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties.tsx index dfb3b09c5e8..1ed536f84ba 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('conditional-properties.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('conditional-properties.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("conditional-properties.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("conditional-properties.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties@component---loader---notFoundComponent---pendingComponent.tsx index 857b130de76..d483dd047cc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/conditional-properties@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,7 +1,7 @@ import { isEnabled } from '@features/feature-flags'; import TrueImport from '@modules/true-component'; import { FalseComponent, falseLoader } from '@modules/false-component'; -const SplitLoader = isEnabled ? TrueImport.loader : falseLoader; -export { SplitLoader as loader }; const SplitComponent = isEnabled ? TrueImport.Component : FalseComponent; -export { SplitComponent as component }; \ No newline at end of file +export { SplitComponent as component }; +const SplitLoader = isEnabled ? TrueImport.loader : falseLoader; +export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple.tsx index 8b823166e47..d8a111acf3d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple.tsx @@ -1,15 +1,7 @@ -const $$splitComponentImporter = () => import('destructured-export-multiple.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-multiple.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const getConfig = () => ({ - baseUrl: 'https://api.example.com', - timeout: 5000 -}); -export const { - baseUrl, - timeout -} = getConfig(); +export const getConfig = () => ({ baseUrl: 'https://api.example.com', timeout: 5000 }); +export const { baseUrl, timeout } = getConfig(); export const [first, second] = [1, 2]; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple@component---loader---notFoundComponent---pendingComponent.tsx index 9441b5a6893..760ed079749 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-multiple@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,8 +1,8 @@ import { baseUrl, timeout } from "destructured-export-multiple.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

Timeout: {timeout}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested.tsx index 5920a891c08..045a8e9a8ce 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested.tsx @@ -1,19 +1,6 @@ -const $$splitComponentImporter = () => import('destructured-export-nested.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export-nested.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -const getConfig = () => ({ - api: { - baseUrl: 'https://api.example.com' - }, - timeout: 5000, - extra: 'data' -}); -export const { - api: { - baseUrl - }, - ...rest -} = getConfig(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const getConfig = () => ({ api: { baseUrl: 'https://api.example.com' }, timeout: 5000, extra: 'data' }); +export const { api: { baseUrl }, ...rest } = getConfig(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested@component---loader---notFoundComponent---pendingComponent.tsx index 8ba46e33e13..a25215497c2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export-nested@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,7 +1,7 @@ import { baseUrl } from "destructured-export-nested.tsx"; function AboutComponent() { - return
+ return (

Base URL: {baseUrl}

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export.tsx index f5737648241..f0ad9ef21ae 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export.tsx @@ -1,17 +1,8 @@ -const $$splitComponentImporter = () => import('destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; + return { getObject: () => ({ constA: 10, constB: 5 }) }; } -export const { - getObject -} = getObjectCallback(); -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const { getObject } = getObjectCallback(); +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@component---loader---notFoundComponent---pendingComponent.tsx index f58942d5afc..63047f4c051 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,14 +1,6 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} function AboutComponent() { - return
+ return (

About

-
; +
); } export { AboutComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@errorComponent.tsx index 45fb19eecd8..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-export@errorComponent.tsx @@ -1,8 +0,0 @@ -export function getObjectCallback() { - return { - getObject: () => ({ - constA: 10, - constB: 5 - }) - }; -} \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component.tsx index 1776055cc22..abe39890244 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('destructured-react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('destructured-react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("destructured-react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("destructured-react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx index 931bed75b4f..d93a065de21 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -3,7 +3,6 @@ import { importedLoader } from '../../shared/imported'; function Component() { return
Component
; } -const SplitLoader = importedLoader; -export { SplitLoader as loader }; const SplitComponent = memo(Component); -export { SplitComponent as component }; \ No newline at end of file +export { SplitComponent as component }; +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults.tsx index 6cac408c56d..56a58861509 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('destructured-route-options-defaults.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('destructured-route-options-defaults.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("destructured-route-options-defaults.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("destructured-route-options-defaults.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/about')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults@component---loader---notFoundComponent---pendingComponent.tsx index 2f8ef91c49a..3cfc350334e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructured-route-options-defaults@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,23 +1,13 @@ function defaultLoader() { - return { - message: 'default' - }; + return { message: 'default' }; } function DefaultComponent() { return
Default
; } -const createBits = () => ({ - component: ActualComponent, - loader: () => ({ - message: 'hello' - }) -}); -const { - component: MyComponent = DefaultComponent, - loader = defaultLoader -} = createBits(); +const createBits = () => ({ component: ActualComponent, loader: () => ({ message: 'hello' }) }); +const { component: MyComponent = DefaultComponent, loader = defaultLoader } = createBits(); function ActualComponent() { return
About
; } -export { loader }; -export { MyComponent as component }; \ No newline at end of file +export { MyComponent as component }; +export { loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@component---loader---notFoundComponent---pendingComponent.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@errorComponent.tsx index 858c5c0e051..6262eb39143 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring@errorComponent.tsx @@ -1,11 +1,5 @@ import thing from 'thing'; export function test() { - const { - foo: { - bar: { - destructured - } - } - } = thing; + const { foo: { bar: { destructured } } } = thing; return destructured; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue.tsx index 178bec9bf7b..eb99c4ed293 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue.tsx @@ -1,8 +1,5 @@ 'use client'; - -const $$splitComponentImporter = () => import('directive-prologue.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("directive-prologue.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/directive')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/directive')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue@component---loader---notFoundComponent---pendingComponent.tsx index ce7cd5e5ee1..d99c313cdd9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/directive-prologue@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,4 @@ 'use client'; - const SplitComponent = () => { return
directive preserved
; }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component-and-normal-notFound.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component-and-normal-notFound.tsx index a3e020c5592..7e1b203a00c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component-and-normal-notFound.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component-and-normal-notFound.tsx @@ -1,15 +1,12 @@ console.warn("[tanstack-router] These exports from \"export-default-component-and-normal-notFound.tsx\" will not be code-split and will increase your bundle size:\n- Home\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitNotFoundComponentImporter = () => import('export-default-component-and-normal-notFound.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("export-default-component-and-normal-notFound.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import React, { useState } from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/home')({ - component: Home, - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); +export const Route = createFileRoute('/home')({ component: Home, notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); export default function Home() { const [one, setOne] = useState('this is from a state'); - return
+ return (

{one}

-
; +
); } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration.tsx index 60764205989..b07f36aca77 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration@component---loader---notFoundComponent---pendingComponent.tsx index d453767c20d..1a42b8a9ab3 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-declaration@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,30 +1,22 @@ +import { Route } from "function-declaration.tsx"; import * as React from 'react'; import { Link, Outlet } from '@tanstack/react-router'; import { fetchPosts } from '../posts'; -import { Route } from "function-declaration.tsx"; function PostsComponent() { const posts = Route.useLoaderData(); - return
+ return (
    - {[...posts, { - id: 'i-do-not-exist', - title: 'Non-existent Post' - }]?.map(post => { - return
  • - + {[...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }]?.map((post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - })} + ); + })}

-
; +
); } -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; +export { fetchPosts as loader }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/importAttribute.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/importAttribute.tsx index cec0324adf2..8ac4b844f4e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/importAttribute.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/importAttribute.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('importAttribute.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("importAttribute.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader.tsx index d79c8e0f32d..9c06a165f55 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('imported-default-component-destructured-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('imported-default-component-destructured-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("imported-default-component-destructured-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("imported-default-component-destructured-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader@component---loader---notFoundComponent---pendingComponent.tsx index d4fc40141e5..16cfce7137c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component-destructured-loader@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import importedComponent, { importedLoader } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component.tsx index c165f652629..9aaef378ca4 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component.tsx @@ -1,6 +1,4 @@ -const $$splitComponentImporter = () => import('imported-default-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("imported-default-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component@component---loader---notFoundComponent---pendingComponent.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-default-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent.tsx index 4152c9af17e..0e5272ef543 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent.tsx @@ -1,8 +1,5 @@ -const $$splitErrorComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=errorComponent'); -const $$splitComponentImporter = () => import('imported-errorComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=errorComponent"); +const $$splitComponentImporter = () => import("imported-errorComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@component---loader---notFoundComponent---pendingComponent.tsx index 31ccf07c526..57fb4126fa2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,2 @@ import ImportedDefaultComponent from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; \ No newline at end of file +export { ImportedDefaultComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@errorComponent.tsx index 7a8654fb942..e53f72933db 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-errorComponent@errorComponent.tsx @@ -1,3 +1,2 @@ import { importedErrorComponent } from '../../shared/imported'; -const SplitErrorComponent = importedErrorComponent; -export { SplitErrorComponent as errorComponent }; \ No newline at end of file +export { importedErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent.tsx index 584c829f37b..f5d396642a6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent.tsx @@ -1,8 +1,5 @@ -const $$splitNotFoundComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('imported-notFoundComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitNotFoundComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("imported-notFoundComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, 'notFoundComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent@component---loader---notFoundComponent---pendingComponent.tsx index 1273c7c50d5..a16abed4002 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-notFoundComponent@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import ImportedDefaultComponent, { importedNotFoundComponent } from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; -const SplitNotFoundComponent = importedNotFoundComponent; -export { SplitNotFoundComponent as notFoundComponent }; \ No newline at end of file +export { ImportedDefaultComponent as component }; +export { importedNotFoundComponent as notFoundComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent.tsx index 1be3f8071be..c41b6fcdac3 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent.tsx @@ -1,8 +1,5 @@ -const $$splitPendingComponentImporter = () => import('imported-pendingComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('imported-pendingComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitPendingComponentImporter = () => import("imported-pendingComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("imported-pendingComponent.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, 'pendingComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, "pendingComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent@component---loader---notFoundComponent---pendingComponent.tsx index 0368000afae..4b2e5b2a0c4 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported-pendingComponent@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import ImportedDefaultComponent, { importedPendingComponent } from '../../shared/imported'; -const SplitComponent = ImportedDefaultComponent; -export { SplitComponent as component }; -const SplitPendingComponent = importedPendingComponent; -export { SplitPendingComponent as pendingComponent }; \ No newline at end of file +export { ImportedDefaultComponent as component }; +export { importedPendingComponent as pendingComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported.tsx index 14356133d64..1a372255cef 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('imported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('imported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("imported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("imported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported@component---loader---notFoundComponent---pendingComponent.tsx index ecc588688b6..4734ee1eebb 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/imported@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ import { importedComponent, importedLoader } from '../../shared'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; -const SplitComponent = importedComponent; -export { SplitComponent as component }; \ No newline at end of file +export { importedComponent as component }; +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline.tsx index 3e2ea1f1c2b..996391c7ddd 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline.tsx @@ -1,9 +1,7 @@ -const $$splitComponentImporter = () => import('inline.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("inline.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component") }); Route.addChildren([]); export const test = 'test'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@component---loader---notFoundComponent---pendingComponent.tsx index 58ccfb29032..da91d03e3d0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,4 @@ +import { Route, test } from "inline.tsx"; import * as React from 'react'; import * as styles from '../style.css'; import { TEST_DATA } from '../test.const'; @@ -6,13 +7,11 @@ const Button = (props: { }) => { return ; }; -import { Route } from "inline.tsx"; -import { test } from "inline.tsx"; const SplitComponent = () => { - return
+ return (
{test}

{TEST_DATA.welcome}

-
; +
); }; export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@errorComponent.tsx index 9236af60214..bd863dd8f99 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline@errorComponent.tsx @@ -1,2 +1,2 @@ -import * as React from 'react'; -import { Route } from "inline.tsx"; \ No newline at end of file +import { Route } from "inline.tsx"; +import * as React from 'react'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/lowercase-function-declaration.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/lowercase-function-declaration.tsx index 574c6d4c2bd..5798895c5bc 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/lowercase-function-declaration.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/lowercase-function-declaration.tsx @@ -1,10 +1,6 @@ -const $$splitErrorComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=errorComponent'); -const $$splitPendingComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -const $$splitComponentImporter = () => import('lowercase-function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitErrorComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=errorComponent"); +const $$splitPendingComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +const $$splitComponentImporter = () => import("lowercase-function-declaration.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, 'pendingComponent'), - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, 'errorComponent') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), pendingComponent: lazyRouteComponent($$splitPendingComponentImporter, "pendingComponent"), errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options.tsx new file mode 100644 index 00000000000..af5cbf04e3d --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options.tsx @@ -0,0 +1,11 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const $$splitErrorComponentImporter = () => import("method-route-options.tsx?tsr-split=errorComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router'; +export const Route = createFileRoute('/method-options')({ loader() { + return state; +}, get component() { + return () =>
{state.count}
; +}, set component(_value) { + state.count++; +}, errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@component---loader---notFoundComponent---pendingComponent.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@errorComponent.tsx new file mode 100644 index 00000000000..8507dad015c --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@errorComponent.tsx @@ -0,0 +1,3 @@ +import { state } from "method-route-options.tsx?tsr-shared=1"; +const SplitErrorComponent = () =>
{state.count}
; +export { SplitErrorComponent as errorComponent }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@shared.tsx new file mode 100644 index 00000000000..d0eb5550fcf --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/method-route-options@shared.tsx @@ -0,0 +1,2 @@ +const state = { count: 0 }; +export { state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number.tsx index 5b4cfaaa9bf..30e9c24da1c 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number.tsx @@ -1,7 +1,7 @@ -const $$splitComponentImporter = () => import('random-number.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('random-number.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("random-number.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("random-number.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { Await, Link, createFileRoute } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -16,13 +16,5 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; export const textColors = [`text-rose-500`, `text-yellow-500`, `text-teal-500`, `text-blue-500`]; export const gradients = [`from-rose-500 to-yellow-500`, `from-yellow-500 to-teal-500`, `from-teal-500 to-violet-500`, `from-blue-500 to-pink-500`]; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -export const Route = createFileRoute('/')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +export const Route = createFileRoute('/')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@component---loader---notFoundComponent---pendingComponent.tsx index c133e05d9ef..115318a2707 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,3 +1,4 @@ +import { textColors, gradients, Route } from "random-number.tsx"; import { Await, Link, defer } from '@tanstack/react-router'; import { Carbon } from '~/components/Carbon'; import { twMerge } from 'tailwind-merge'; @@ -14,56 +15,26 @@ import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; import { useMutation } from '~/hooks/useMutation'; import { sample } from '~/utils/utils'; -import { textColors } from "random-number.tsx"; -import { gradients } from "random-number.tsx"; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; -import { Route } from "random-number.tsx"; -async function bytesSignupServerFn({ - email -}: { +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; +async function bytesSignupServerFn({ email }: { email: string; }) { 'use server'; - - return fetch(`https://bytes.dev/api/bytes-optin-cors`, { - method: 'POST', - body: JSON.stringify({ - email, - influencer: 'tanstack' - }), - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json' - } - }); + return fetch(`https://bytes.dev/api/bytes-optin-cors`, { method: 'POST', body: JSON.stringify({ email, influencer: 'tanstack' }), headers: { Accept: 'application/json', 'Content-Type': 'application/json' } }); } function Index() { - const bytesSignupMutation = useMutation({ - fn: bytesSignupServerFn - }); - const { - sponsorsPromise, - randomNumber, - testing2 - } = Route.useLoaderData(); + const bytesSignupMutation = useMutation({ fn: bytesSignupServerFn }); + const { sponsorsPromise, randomNumber, testing2 } = Route.useLoaderData(); const gradient = sample(gradients, randomNumber); const textColor = sample(textColors, randomNumber); - return <> + return (<> {discordImage} {gradient} {textColor} - ; + ); } const SplitLoader = () => { - return { - randomNumber: Math.random(), - sponsorsPromise: defer(getSponsorsForSponsorPack()) - }; + return { randomNumber: Math.random(), sponsorsPromise: defer(getSponsorsForSponsorPack()) }; }; export { SplitLoader as loader }; export { Index as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@errorComponent.tsx index cdf4d378912..2d105853a45 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/random-number@errorComponent.tsx @@ -10,9 +10,4 @@ import agGridImage from '~/images/ag-grid.png'; import nozzleImage from '~/images/nozzle.png'; import bytesImage from '~/images/bytes.svg'; import bytesUidotdevImage from '~/images/bytes-uidotdev.png'; -const courses = [{ - name: 'The Official TanStack React Query Course', - cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, - href: 'https://query.gg/?s=tanstack', - description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` -}]; \ No newline at end of file +const courses = [{ name: 'The Official TanStack React Query Course', cardStyles: `border-t-4 border-red-500 hover:(border-green-500)`, href: 'https://query.gg/?s=tanstack', description: `Learn how to build enterprise quality apps with TanStack's React Query the easy way with our brand new course.` }]; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component.tsx index 568c8dc323b..53f3ad2c6e9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('react-memo-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('react-memo-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("react-memo-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("react-memo-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component@component---loader---notFoundComponent---pendingComponent.tsx index 70d8b0eb42f..305c82d1612 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -3,7 +3,6 @@ import { importedLoader } from '../../shared/imported'; function Component() { return
Component
; } -const SplitLoader = importedLoader; -export { SplitLoader as loader }; const SplitComponent = React.memo(Component); -export { SplitComponent as component }; \ No newline at end of file +export { SplitComponent as component }; +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component.tsx index 233eca72a0e..c86763c9dd0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component.tsx @@ -1,9 +1,6 @@ -const $$splitLoaderImporter = () => import('react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -const $$splitComponentImporter = () => import('react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +const $$splitComponentImporter = () => import("react-memo-imported-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx index d2671013eff..ed7c539219f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/react-memo-imported-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { importedLoader, importedComponent } from '../../shared/imported'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; const SplitComponent = React.memo(importedComponent); -export { SplitComponent as component }; \ No newline at end of file +export { SplitComponent as component }; +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component.tsx index 1b00751ae6e..55bdcf6e6bd 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component.tsx @@ -1,14 +1,12 @@ console.warn("[tanstack-router] These exports from \"retain-export-component.tsx\" will not be code-split and will increase your bundle size:\n- Layout\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitLoaderImporter = () => import('retain-export-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitLoaderImporter = () => import("retain-export-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute, Outlet } from '@tanstack/react-router'; import { importedComponent as ImportedComponent } from '../../shared/imported'; export function Layout() { - return
-
+ return (
+
-
; +
); } -export const Route = createFileRoute('/_layout')({ - component: Layout, - loader: lazyFn($$splitLoaderImporter, 'loader') -}); +export const Route = createFileRoute('/_layout')({ component: Layout, loader: lazyFn($$splitLoaderImporter, "loader") }); const HEADER_HEIGHT = '63px'; export const SIDEBAR_WIDTH = '150px'; const SIDEBAR_MINI_WIDTH = '80px'; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component@component---loader---notFoundComponent---pendingComponent.tsx index 9787e27ad7f..5faf3e93fc1 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-export-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -2,5 +2,4 @@ import * as React from 'react'; import { importedLoader } from '../../shared/imported'; const SIDEBAR_MINI_WIDTH = '80px'; const ASIDE_WIDTH = '250px'; -const SplitLoader = importedLoader; -export { SplitLoader as loader }; \ No newline at end of file +export { importedLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-destructured@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-destructured@component---loader---notFoundComponent---pendingComponent.tsx index 43108700f54..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-destructured@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-destructured@component---loader---notFoundComponent---pendingComponent.tsx @@ -1 +0,0 @@ -export { SplitLoader as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader.tsx index b36cbc6be2e..9700cdef9e3 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader.tsx @@ -1,17 +1,12 @@ console.warn("[tanstack-router] These exports from \"retain-exports-loader.tsx\" will not be code-split and will increase your bundle size:\n- loaderFn\nFor the best optimization, these items should either have their export statements removed, or be imported from another location that is not a route file."); -const $$splitComponentImporter = () => import('retain-exports-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("retain-exports-loader.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; import * as React from 'react'; import { createFileRoute } from '@tanstack/react-router'; export function loaderFn() { - return { - foo: 'bar' - }; + return { foo: 'bar' }; } -export const Route = createFileRoute('/_layout')({ - component: lazyRouteComponent($$splitComponentImporter, 'component'), - loader: loaderFn -}); +export const Route = createFileRoute('/_layout')({ component: lazyRouteComponent($$splitComponentImporter, "component"), loader: loaderFn }); export const SIDEBAR_WIDTH = '150px'; export const SIDEBAR_MINI_WIDTH = '80px'; const ASIDE_WIDTH = '250px'; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader@component---loader---notFoundComponent---pendingComponent.tsx index 9f54ae0dc57..5b37e491605 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-loader@component---loader---notFoundComponent---pendingComponent.tsx @@ -2,10 +2,8 @@ import * as React from 'react'; import { Outlet } from '@tanstack/react-router'; import { importedComponent as ImportedComponent } from '../../shared/imported'; function Layout() { - return
-
+ return (
+
-
; +
); } const HEADER_HEIGHT = '63px'; const ASIDE_WIDTH = '250px'; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class.tsx index 48afc3f0705..f1cf964e0ab 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class.tsx @@ -1,18 +1,6 @@ -const $$splitComponentImporter = () => import('shared-class.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-class.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-class.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-class.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -class DataStore { - data = new Map(); - get(k: string) { - return this.data.get(k); - } - set(k: string, v: unknown) { - this.data.set(k, v); - } -} -export const Route = createFileRoute('/store')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/store')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class@errorComponent.tsx index 0a50638c6ac..e69de29bb2d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class@errorComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-class@errorComponent.tsx @@ -1,9 +0,0 @@ -class DataStore { - data = new Map(); - get(k: string) { - return this.data.get(k); - } - set(k: string, v: unknown) { - this.data.set(k, v); - } -} \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured-export.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured-export.tsx index 73f1b54389f..1f3a56a18c9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured-export.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured-export.tsx @@ -1,19 +1,10 @@ -const $$splitComponentImporter = () => import('shared-destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-destructured-export.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const { - apiUrl, - timeout -} = getConfig(); -export const Route = createFileRoute('/config')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); +export const { apiUrl, timeout } = getConfig(); +export const Route = createFileRoute('/config')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured.tsx index fbc4272c3ef..861c53f852a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-destructured.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-destructured.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-destructured.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-destructured.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/config')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/config')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured@component---loader---notFoundComponent---pendingComponent.tsx index e92f7dd7f82..d3930656b67 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-destructured@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,12 +1,6 @@ -const { - apiUrl, - timeout -} = getConfig(); +const { apiUrl, timeout } = getConfig(); function getConfig() { - return { - apiUrl: '/api', - timeout: 5000 - }; + return { apiUrl: '/api', timeout: 5000 }; } const SplitLoader = async () => fetch(apiUrl); export { SplitLoader as loader }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported.tsx index 76a5d29dc3a..c6f40046601 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported.tsx @@ -1,13 +1,7 @@ -const $$splitComponentImporter = () => import('shared-exported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-exported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-exported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-exported.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const queryOptions = { - staleTime: 5000, - gcTime: 10000 -}; -export const Route = createFileRoute('/query')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const queryOptions = { staleTime: 5000, gcTime: 10000 }; +export const Route = createFileRoute('/query')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported@component---loader---notFoundComponent---pendingComponent.tsx index f77f81cbdba..e320f636322 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-exported@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,8 +1,6 @@ import { queryOptions } from "shared-exported.tsx"; const SplitLoader = async () => { - return { - staleTime: queryOptions.staleTime - }; + return { staleTime: queryOptions.staleTime }; }; export { SplitLoader as loader }; const SplitComponent = () =>
GC: {queryOptions.gcTime}
; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function.tsx index 8a921d96405..a2a9612b911 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/cached')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/cached')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function@component---loader---notFoundComponent---pendingComponent.tsx index cfe519f47a3..edc5c5bbb94 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-function@component---loader---notFoundComponent---pendingComponent.tsx @@ -6,7 +6,7 @@ function setCached(key: string, val: unknown) { cache.set(key, val); } const SplitLoader = async () => { - setCached('data', await fetch('/api').then(r => r.json())); + setCached('data', await fetch('/api').then((r) => r.json())); return getCached('data'); }; export { SplitLoader as loader }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-imported-binding.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-imported-binding.tsx index feb46cd7899..1a172f50d4e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-imported-binding.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-imported-binding.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-imported-binding.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-imported-binding.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-imported-binding.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-imported-binding.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/imported')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/imported')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref.tsx index 4275e17e58d..2c20bd7e529 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-indirect-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-indirect-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-indirect-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-indirect-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/shared-indirect')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/shared-indirect')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref@component---loader---notFoundComponent---pendingComponent.tsx index 090f3b5c73b..438acffa818 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-indirect-ref@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,19 +1,15 @@ -const state = { - count: 0 -}; +const state = { count: 0 }; function getCount() { return state.count; } function SharedComponent() { - return
+ return (
{getCount()} - {state.count} -
; +
); } const SplitLoader = () => { state.count++; - return { - count: getCount() - }; + return { count: getCount() }; }; export { SplitLoader as loader }; export { SharedComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref.tsx index 130c7ce120f..9cc862de3a9 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-jsx-component-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-jsx-component-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-jsx-component-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-jsx-component-ref.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; // @ts-nocheck import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/jsx')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/jsx')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref@component---loader---notFoundComponent---pendingComponent.tsx index c5fd18664e7..84c0e8847d0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-jsx-component-ref@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,5 +1,3 @@ -// @ts-nocheck - const shared = 1; function SharedComponent() { return
{shared}
; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none.tsx index eac0f9ab0af..b6566f156df 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-none.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-none.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-none.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-none.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/clean')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/clean')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none@component---loader---notFoundComponent---pendingComponent.tsx index f9f52ba6be7..528799ec5a0 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-none@component---loader---notFoundComponent---pendingComponent.tsx @@ -2,7 +2,7 @@ const loaderHelper = () => fetch('/api'); const ComponentHelper = () => helper; const SplitLoader = async () => loaderHelper(); export { SplitLoader as loader }; -const SplitComponent = () =>
+const SplitComponent = () => (
-
; +
); export { SplitComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route.tsx index 9aebb45a95a..0fa7281d0d6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-referencing-route.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-referencing-route.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-referencing-route.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-referencing-route.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/about')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/about')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route@component---loader---notFoundComponent---pendingComponent.tsx index 9bcd130ea89..0f7014f8a8e 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-referencing-route@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,13 +1,11 @@ +import { Route } from "shared-referencing-route.tsx"; const HEADER = 'Page'; function usePageTitle() { return `${HEADER} - ${Route.fullPath}`; } -import { Route } from "shared-referencing-route.tsx"; const SplitLoader = async () => { const title = usePageTitle(); - return { - title - }; + return { title }; }; export { SplitLoader as loader }; const SplitComponent = () => { diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime.tsx index d88eff9d9b9..eb7c88dc171 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime.tsx @@ -1,22 +1,9 @@ -import { state, createState, createSeed } from "shared-runtime.tsx?tsr-shared=1"; -const $$splitComponentImporter = () => import('shared-runtime.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-runtime.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +import { state } from "shared-runtime.tsx?tsr-shared=1"; +const $$splitComponentImporter = () => import("shared-runtime.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-runtime.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('shared-runtime:reference'); -export const Route = createFileRoute('/shared-runtime')({ - beforeLoad: () => state, - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; \ No newline at end of file +export const Route = createFileRoute('/shared-runtime')({ beforeLoad: () => state, loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); +export { createSeed as default, state as firstState, state as secondState, state as "odd-name" } from "shared-runtime.tsx?tsr-shared=1"; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@component---loader---notFoundComponent---pendingComponent.tsx index 0af87c21c51..bcef5e66675 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,19 +1,9 @@ -import { state, createState, createSeed, Labels, increment } from "shared-runtime.tsx?tsr-shared=1"; +import { state, Labels, increment } from "shared-runtime.tsx?tsr-shared=1"; const label = createComponentLabel(); -function createState(initialState: { - count: number; -}): { - state: { - count: number; - }; - increment: () => number; -}; function createComponentLabel() { console.log('shared-runtime:component'); return Labels.component; } -export { state as firstState, state as secondState, state as 'odd-name' }; -export default createSeed; const SplitLoader = () => { increment(); return state; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@shared.tsx index 54239b6cc59..5b947f61be2 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@shared.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-runtime@shared.tsx @@ -1,28 +1,27 @@ -const Count = { - Initial: 0 -}; -const Labels = { - component: 'count' -}; +enum Count { + Initial = 0 +} +namespace Labels { + export const component = 'count'; +} const seed = createSeed(); -const { - state, - increment -} = createState(seed); +const { state, increment } = createState(seed); function createSeed() { console.log('shared-runtime:seed'); - return { - count: Count.Initial, - label: Labels.component - }; + return { count: Count.Initial, label: Labels.component }; } +function createState(initialState: { + count: number; +}): { + state: { + count: number; + }; + increment: () => number; +}; function createState(initialState: { count: number; }) { console.log('shared-runtime:state'); - return { - state: initialState, - increment: () => initialState.count++ - }; + return { state: initialState, increment: () => initialState.count++ }; } -export { Count, createSeed, createState, increment, Labels, seed, state }; \ No newline at end of file +export { Count, Labels, createSeed, createState, increment, seed, state }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive.tsx index 67b0631b8ed..7620fc69a3f 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-transitive.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-transitive.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-transitive.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-transitive.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/api')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/api')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive@component---loader---notFoundComponent---pendingComponent.tsx index 662d7fd7aa2..b1061c2b67d 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-transitive@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,8 +1,5 @@ const BASE_URL = 'https://api.example.com'; -const config = { - url: BASE_URL, - timeout: 5000 -}; +const config = { url: BASE_URL, timeout: 5000 }; const fetcher = (path: string) => fetch(`${config.url}${path}`); const SplitLoader = async () => { return fetcher('/data'); diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable.tsx index 48cdad100e8..475e632ec03 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('shared-variable.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-variable.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-variable.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-variable.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/todos')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/todos')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable@component---loader---notFoundComponent---pendingComponent.tsx index daca782a6fc..688d78804b6 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-variable@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,12 +1,7 @@ -const collection = { - name: 'todos', - preload: async () => {} -}; +const collection = { name: 'todos', preload: async () => {} }; const SplitLoader = async () => { await collection.preload(); - return { - data: 'loaded' - }; + return { data: 'loaded' }; }; export { SplitLoader as loader }; const SplitComponent = () =>
{collection.name}
; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-with-side-effect.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-with-side-effect.tsx index c3227467377..70457c9eab4 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-with-side-effect.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/shared-with-side-effect.tsx @@ -1,10 +1,7 @@ -const $$splitComponentImporter = () => import('shared-with-side-effect.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/react-router'; -const $$splitLoaderImporter = () => import('shared-with-side-effect.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; +const $$splitComponentImporter = () => import("shared-with-side-effect.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/react-router"; +const $$splitLoaderImporter = () => import("shared-with-side-effect.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; import { createFileRoute } from '@tanstack/react-router'; console.log('registry created'); -export const Route = createFileRoute('/fx')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/fx')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using.tsx index 140f394f600..91351f7c9b7 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using.tsx @@ -1,5 +1,3 @@ -const $$splitLoaderImporter = () => import('using.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/react-router'; -export const Route = createFileRoute({ - loader: lazyFn($$splitLoaderImporter, 'loader') -}); \ No newline at end of file +const $$splitLoaderImporter = () => import("using.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/react-router"; +export const Route = createFileRoute({ loader: lazyFn($$splitLoaderImporter, "loader") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using@component---loader---notFoundComponent---pendingComponent.tsx index 7e4f4fde9b9..54d6fced97b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/using@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,16 +1,5 @@ -const DummyPostResource = (postId: string) => ({ - postData: { - id: postId, - title: 'dummy', - body: 'dummy' - }, - [Symbol.dispose]: () => console.log('disposing!') -}); -const SplitLoader = ({ - params: { - postId - } -}) => { +const DummyPostResource = (postId: string) => ({ postData: { id: postId, title: 'dummy', body: 'dummy' }, [Symbol.dispose]: () => console.log('disposing!') }); +const SplitLoader = ({ params: { postId } }) => { using dummyPost = DummyPostResource(postId); return dummyPost.postData; }; diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function.tsx index b09548da578..80eb551a164 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function.tsx @@ -1,8 +1,5 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component'); -import { lazyRouteComponent } from '@tanstack/solid-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component"); +import { lazyRouteComponent } from "@tanstack/solid-router"; import { createFileRoute } from '@tanstack/solid-router'; import { fetchPosts } from '../posts'; -export const Route = createFileRoute('/posts')({ - loader: fetchPosts, - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: fetchPosts, component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function@component.tsx index fe44a34fe16..48fad8a7002 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function@component.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/1-default/arrow-function@component.tsx @@ -1,26 +1,22 @@ +import { Route } from "arrow-function.tsx"; import * as Solid from 'solid-js'; import { Link, Outlet } from '@tanstack/solid-router'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {post => { - return
  • - + {(post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - }} + ); + }}

-
; +
); }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function.tsx index 61c77d73bda..637c215a54a 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/solid-router'; -const $$splitLoaderImporter = () => import('arrow-function.tsx?tsr-split=loader'); -import { lazyFn } from '@tanstack/solid-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/solid-router"; +const $$splitLoaderImporter = () => import("arrow-function.tsx?tsr-split=loader"); +import { lazyFn } from "@tanstack/solid-router"; import { createFileRoute } from '@tanstack/solid-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx index fe44a34fe16..48fad8a7002 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -1,26 +1,22 @@ +import { Route } from "arrow-function.tsx"; import * as Solid from 'solid-js'; import { Link, Outlet } from '@tanstack/solid-router'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {post => { - return
  • - + {(post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - }} + ); + }}

-
; +
); }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@loader.tsx index d9ed4ea7afd..23119ae8b68 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@loader.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/2-components-combined-loader-separate/arrow-function@loader.tsx @@ -1,3 +1,2 @@ import { fetchPosts } from '../posts'; -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; \ No newline at end of file +export { fetchPosts as loader }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function.tsx index a872f13d330..cb09ebaa15b 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function.tsx @@ -1,9 +1,6 @@ -const $$splitComponentImporter = () => import('arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyRouteComponent } from '@tanstack/solid-router'; -const $$splitLoaderImporter = () => import('arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent'); -import { lazyFn } from '@tanstack/solid-router'; +const $$splitComponentImporter = () => import("arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyRouteComponent } from "@tanstack/solid-router"; +const $$splitLoaderImporter = () => import("arrow-function.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent"); +import { lazyFn } from "@tanstack/solid-router"; import { createFileRoute } from '@tanstack/solid-router'; -export const Route = createFileRoute('/posts')({ - loader: lazyFn($$splitLoaderImporter, 'loader'), - component: lazyRouteComponent($$splitComponentImporter, 'component') -}); \ No newline at end of file +export const Route = createFileRoute('/posts')({ loader: lazyFn($$splitLoaderImporter, "loader"), component: lazyRouteComponent($$splitComponentImporter, "component") }); \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx index 2ea36d2e032..f85b55de042 100644 --- a/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx +++ b/packages/router-plugin/tests/code-splitter/snapshots/solid/3-all-combined-errorComponent-separate/arrow-function@component---loader---notFoundComponent---pendingComponent.tsx @@ -1,29 +1,24 @@ +import { Route } from "arrow-function.tsx"; import * as Solid from 'solid-js'; import { Link, Outlet } from '@tanstack/solid-router'; import { fetchPosts } from '../posts'; -import { Route } from "arrow-function.tsx"; const PostsComponent = () => { const posts = Route.useLoaderData(); - return
+ return (
    - {post => { - return
  • - + {(post) => { + return (
  • +
    {post.title.substring(0, 20)}
    -
  • ; - }} + ); + }}

-
; +
); }; -const SplitLoader = fetchPosts; -export { SplitLoader as loader }; +export { fetchPosts as loader }; export { PostsComponent as component }; \ No newline at end of file diff --git a/packages/router-plugin/tests/code-splitter/test-files/react/method-route-options.tsx b/packages/router-plugin/tests/code-splitter/test-files/react/method-route-options.tsx new file mode 100644 index 00000000000..442d4dd7ef1 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/test-files/react/method-route-options.tsx @@ -0,0 +1,16 @@ +import { createFileRoute } from '@tanstack/react-router' + +const state = { count: 0 } + +export const Route = createFileRoute('/method-options')({ + loader() { + return state + }, + get component() { + return () =>
{state.count}
+ }, + set component(_value) { + state.count++ + }, + errorComponent: () =>
{state.count}
, +}) diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRoute-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRoute-ssr-function.tsx index a442b9ad2f4..38a484ad9f5 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRoute-ssr-function.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRoute-ssr-function.tsx @@ -1,6 +1,4 @@ import { createRootRoute } from '@tanstack/react-router'; -export const Route = createRootRoute({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createRootRoute({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRouteWithContext-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRouteWithContext-ssr-function.tsx index 75c818b0725..153710e5df9 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRouteWithContext-ssr-function.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createRootRouteWithContext-ssr-function.tsx @@ -1,6 +1,4 @@ import { createRootRouteWithContext } from '@tanstack/react-router'; -export const Route = createRootRouteWithContext<{}>()({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createRootRouteWithContext<{}>()({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-data-only.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-data-only.tsx index cd2371ae2e2..6ac36b9ae8a 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-data-only.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-data-only.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-false.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-false.tsx index cd2371ae2e2..6ac36b9ae8a 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-false.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-false.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-function.tsx index cd2371ae2e2..6ac36b9ae8a 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-function.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/ssr-function.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/react-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-data-only.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-data-only.tsx index 77e05f3b124..0c6f167575c 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-data-only.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-data-only.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/solid-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-false.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-false.tsx index 77e05f3b124..0c6f167575c 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-false.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-false.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/solid-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-function.tsx index 77e05f3b124..0c6f167575c 100644 --- a/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-function.tsx +++ b/packages/router-plugin/tests/delete-nodes/snapshots/solid/3-delete-nodes-ssr/ssr-function.tsx @@ -1,6 +1,4 @@ import { createFileRoute } from '@tanstack/solid-router'; -export const Route = createFileRoute('/')({ - component: () => { - return
hello world
; - } -}); \ No newline at end of file +export const Route = createFileRoute('/')({ component: () => { + return
hello world
; +} }); \ No newline at end of file diff --git a/packages/router-plugin/tests/detect-route-codesplit-groupings.test.ts b/packages/router-plugin/tests/detect-route-codesplit-groupings.test.ts index 281f25127eb..3673510831f 100644 --- a/packages/router-plugin/tests/detect-route-codesplit-groupings.test.ts +++ b/packages/router-plugin/tests/detect-route-codesplit-groupings.test.ts @@ -122,7 +122,7 @@ describe('detectCodeSplitGroupingsFromRoute - success', () => { ({ code, expectedGrouping }) => { const result = detectCodeSplitGroupingsFromRoute({ code: code, - sourceFilename: 'test.ts', + filename: 'test.ts', }) expect(result.groupings).toEqual(expectedGrouping) @@ -187,7 +187,7 @@ describe('detectCodeSplitGroupingsFromRoute - fail', () => { expect(() => detectCodeSplitGroupingsFromRoute({ code: code, - sourceFilename: 'test.ts', + filename: 'test.ts', }), ).toThrowError() }) diff --git a/packages/router-plugin/tests/router-plugin-context.test.ts b/packages/router-plugin/tests/router-plugin-context.test.ts index d3fb0563e60..91c33f1c04d 100644 --- a/packages/router-plugin/tests/router-plugin-context.test.ts +++ b/packages/router-plugin/tests/router-plugin-context.test.ts @@ -1,7 +1,7 @@ import path from 'node:path' -import * as t from '@babel/types' +import { is } from 'yuku-ast' import { describe, expect, it, vi } from 'vitest' -import { parseAst } from '@tanstack/router-utils' +import { analyzeModule } from '@tanstack/router-utils' import { createRouterCodeSplitterPlugin } from '../src/core/router-code-splitter-plugin' import { unpluginRouterComposedFactory } from '../src/core/router-composed-plugin' import { createRouterHmrPlugin } from '../src/core/router-hmr-plugin' @@ -78,12 +78,12 @@ function getCode(result: TransformResult | null | undefined) { } function countProgramHotDeclarations(code: string) { - const ast = parseAst({ code }) - return ast.program.body.filter((statement) => { + const ast = analyzeModule({ code }) + return ast.ast.body.filter((statement) => { return ( - t.isVariableDeclaration(statement) && + is.VariableDeclaration(statement) && statement.declarations.some((declaration) => { - return t.isIdentifier(declaration.id) && declaration.id.name === 'hot' + return is.Identifier(declaration.id) && declaration.id.name === 'hot' }) ) }).length @@ -192,25 +192,7 @@ export const Route = createFileRoute('/changing')({ const combined = await setup(true) const first = await separate(source('firstState', 'first version')) expect(first.reference).toContain('tsr-split=component') - const virtualImports = parseAst({ - code: first.virtual, - }).program.body.filter((statement) => t.isImportDeclaration(statement)) - expect(virtualImports).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - source: expect.objectContaining({ - value: expect.stringContaining('tsr-shared'), - }), - specifiers: expect.arrayContaining([ - expect.objectContaining({ - type: 'ImportSpecifier', - imported: expect.objectContaining({ name: 'firstState' }), - local: expect.objectContaining({ name: 'firstState' }), - }), - ]), - }), - ]), - ) + expect(first.virtual).toContain('import { firstState }') expect(first.shared).toContain('first version') const second = await separate(source('secondState', 'second version')) diff --git a/packages/router-plugin/tests/shared-bindings-helpers.test.ts b/packages/router-plugin/tests/shared-bindings-helpers.test.ts index 3198c15fb98..8e3b8a6d803 100644 --- a/packages/router-plugin/tests/shared-bindings-helpers.test.ts +++ b/packages/router-plugin/tests/shared-bindings-helpers.test.ts @@ -1,55 +1,11 @@ import { describe, expect, it } from 'vitest' -import * as t from '@babel/types' -import { parseAst } from '@tanstack/router-utils' - import { addSharedSearchParamToFilename, - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromNode, - collectLocalBindingsFromStatement, - collectModuleLevelRefsFromNode, computeSharedBindings, - expandDestructuredDeclarations, - expandTransitively, - removeBindingsDependingOnRoute, } from '../src/core/code-splitter/compilers' import { defaultCodeSplitGroupings } from '../src/core/constants' import type { CodeSplitGroupings } from '../src/core/constants' -// ─── Test helpers ────────────────────────────────────────── - -function parse(code: string) { - return parseAst({ code }) -} - -function collectBindings(code: string): Set { - const ast = parse(code) - const bindings = new Set() - for (const node of ast.program.body) { - collectLocalBindingsFromStatement(node, bindings) - } - return bindings -} - -/** Build a dep graph from code for convenience */ -function graphFromCode(code: string) { - const ast = parse(code) - const locals = new Set() - for (const node of ast.program.body) { - collectLocalBindingsFromStatement(node, locals) - } - const declMap = buildDeclarationMap(ast) - return { - ast, - locals, - declMap, - depGraph: buildDependencyGraph(declMap, locals), - } -} - -// ─── addSharedSearchParamToFilename ──────────────────────── - describe('addSharedSearchParamToFilename', () => { it('should append tsr-shared=1 to bare filename', () => { expect(addSharedSearchParamToFilename('src/routes/index.tsx')).toBe( @@ -66,503 +22,6 @@ describe('addSharedSearchParamToFilename', () => { }) }) -// ─── collectIdentifiersFromNode ─────────────────────────── - -describe('collectIdentifiersFromNode', () => { - it('should collect from a simple identifier', () => { - const ast = parse('const x = foo') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - expect(collectIdentifiersFromNode(init)).toEqual(new Set(['foo'])) - }) - - it('should collect from a binary expression', () => { - const ast = parse('const x = a + b') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - expect(collectIdentifiersFromNode(init)).toEqual(new Set(['a', 'b'])) - }) - - it('should ignore object literal keys', () => { - const ast = parse('const x = { key: value }') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - const ids = collectIdentifiersFromNode(init) - expect(ids).toContain('value') - expect(ids).not.toContain('key') - }) - - it('should ignore member expression properties', () => { - const ast = parse('const x = obj.prop + obj[dynamic]') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - const ids = collectIdentifiersFromNode(init) - expect(ids).toContain('obj') - expect(ids).toContain('dynamic') - expect(ids).not.toContain('prop') - }) - - it('should collect from a call expression', () => { - const ast = parse('const x = foo(bar, baz)') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - expect(collectIdentifiersFromNode(init)).toEqual( - new Set(['foo', 'bar', 'baz']), - ) - }) - - it('should collect from arrow function body', () => { - const ast = parse('const x = () => a + b') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - const ids = collectIdentifiersFromNode(init) - expect(ids).toContain('a') - expect(ids).toContain('b') - }) - - it('should collect from member expressions', () => { - const ast = parse('const x = obj.prop') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - const ids = collectIdentifiersFromNode(init) - expect(ids).toContain('obj') - // property name is not a referenced identifier - expect(ids).not.toContain('prop') - }) - - it('should collect from nested structures', () => { - const ast = parse('const x = { key: fn(val) }') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - const ids = collectIdentifiersFromNode(init) - expect(ids).toContain('fn') - expect(ids).toContain('val') - // object literal keys are not referenced identifiers - expect(ids).not.toContain('key') - }) - - it('should return empty set for a numeric literal', () => { - const ast = parse('const x = 42') - const decl = ast.program.body[0] as t.VariableDeclaration - const init = decl.declarations[0]!.init! - expect(collectIdentifiersFromNode(init).size).toBe(0) - }) - - it('should collect from function declaration body', () => { - const ast = parse('function foo() { return bar + baz }') - const fn = ast.program.body[0]! - const ids = collectIdentifiersFromNode(fn) - // function name is a binding, not a reference - expect(ids).not.toContain('foo') - expect(ids).toContain('bar') - expect(ids).toContain('baz') - }) -}) - -// ─── collectLocalBindingsFromStatement ───────────────────── - -describe('collectLocalBindingsFromStatement', () => { - it('should collect from const declaration', () => { - expect(collectBindings('const x = 1')).toEqual(new Set(['x'])) - }) - - it('should collect from let declaration', () => { - expect(collectBindings('let x = 1')).toEqual(new Set(['x'])) - }) - - it('should collect from multiple declarators', () => { - expect(collectBindings('const x = 1, y = 2')).toEqual(new Set(['x', 'y'])) - }) - - it('should collect from function declaration', () => { - expect(collectBindings('function foo() {}')).toEqual(new Set(['foo'])) - }) - - it('should collect from class declaration', () => { - expect(collectBindings('class Foo {}')).toEqual(new Set(['Foo'])) - }) - - it('should collect from exported variable declaration', () => { - expect(collectBindings('export const x = 1')).toEqual(new Set(['x'])) - }) - - it('should collect from exported function declaration', () => { - expect(collectBindings('export function foo() {}')).toEqual( - new Set(['foo']), - ) - }) - - it('should collect from exported class declaration', () => { - expect(collectBindings('export class Foo {}')).toEqual(new Set(['Foo'])) - }) - - it('should collect from object destructuring', () => { - expect(collectBindings('const { a, b } = obj')).toEqual(new Set(['a', 'b'])) - }) - - it('should collect from nested object destructuring', () => { - expect(collectBindings('const { a: { b, c } } = obj')).toEqual( - new Set(['b', 'c']), - ) - }) - - it('should collect from array destructuring', () => { - expect(collectBindings('const [a, b] = arr')).toEqual(new Set(['a', 'b'])) - }) - - it('should collect from destructuring with defaults', () => { - expect(collectBindings('const { a = 1, b = 2 } = obj')).toEqual( - new Set(['a', 'b']), - ) - }) - - it('should collect from destructuring with rest', () => { - expect(collectBindings('const { a, ...rest } = obj')).toEqual( - new Set(['a', 'rest']), - ) - }) - - it('should collect from exported destructuring', () => { - expect(collectBindings('export const { a, b } = fn()')).toEqual( - new Set(['a', 'b']), - ) - }) - - it('should NOT collect from import declarations', () => { - expect(collectBindings("import { a } from './mod'")).toEqual(new Set()) - }) - - it('should NOT collect from expression statements', () => { - expect(collectBindings('console.log("hello")')).toEqual(new Set()) - }) - - it('should collect from renamed destructuring', () => { - expect(collectBindings('const { a: renamedA } = obj')).toEqual( - new Set(['renamedA']), - ) - }) - - it('should collect from multiple statements', () => { - const code = ` -const x = 1 -function foo() {} -class Bar {} -` - expect(collectBindings(code)).toEqual(new Set(['x', 'foo', 'Bar'])) - }) -}) - -// ─── buildDeclarationMap ────────────────────────────────── - -describe('buildDeclarationMap', () => { - it('should map variable names to their declarator nodes', () => { - const ast = parse('const x = 1\nconst y = 2') - const map = buildDeclarationMap(ast) - expect(map.has('x')).toBe(true) - expect(map.has('y')).toBe(true) - expect(t.isVariableDeclarator(map.get('x'))).toBe(true) - }) - - it('should map function declarations', () => { - const ast = parse('function foo() {}') - const map = buildDeclarationMap(ast) - expect(map.has('foo')).toBe(true) - expect(t.isFunctionDeclaration(map.get('foo'))).toBe(true) - }) - - it('should map class declarations', () => { - const ast = parse('class Bar {}') - const map = buildDeclarationMap(ast) - expect(map.has('Bar')).toBe(true) - expect(t.isClassDeclaration(map.get('Bar'))).toBe(true) - }) - - it('should map exported declarations', () => { - const ast = parse('export const x = 1\nexport function foo() {}') - const map = buildDeclarationMap(ast) - expect(map.has('x')).toBe(true) - expect(map.has('foo')).toBe(true) - }) - - it('should map destructured bindings to same declarator', () => { - const ast = parse('const { a, b } = fn()') - const map = buildDeclarationMap(ast) - expect(map.has('a')).toBe(true) - expect(map.has('b')).toBe(true) - expect(map.get('a')).toBe(map.get('b')) - }) - - it('should not include imports', () => { - const ast = parse("import { x } from './mod'\nconst y = 1") - const map = buildDeclarationMap(ast) - expect(map.has('x')).toBe(false) - expect(map.has('y')).toBe(true) - }) -}) - -// ─── buildDependencyGraph ───────────────────────────────── - -describe('buildDependencyGraph', () => { - it('should detect direct dependency', () => { - const { depGraph } = graphFromCode('const a = 1\nconst b = a + 1') - expect(depGraph.get('b')).toEqual(new Set(['a'])) - expect(depGraph.get('a')).toEqual(new Set()) - }) - - it('should not include self-references', () => { - const { depGraph } = graphFromCode('const a = () => a()') - expect(depGraph.get('a')!.has('a')).toBe(false) - }) - - it('should not include imported identifiers', () => { - const { depGraph } = graphFromCode( - "import { ext } from './mod'\nconst a = ext + 1", - ) - // ext is not in locals, so not in deps - expect(depGraph.get('a')!.has('ext')).toBe(false) - }) - - it('should handle multiple deps', () => { - const { depGraph } = graphFromCode( - 'const a = 1\nconst b = 2\nconst c = a + b', - ) - expect(depGraph.get('c')).toEqual(new Set(['a', 'b'])) - }) - - it('should handle function declaration deps', () => { - const { depGraph } = graphFromCode( - 'const config = {}\nfunction init() { return config }', - ) - expect(depGraph.get('init')).toEqual(new Set(['config'])) - }) - - it('should handle chain deps (each link direct only)', () => { - const { depGraph } = graphFromCode('const a = 1\nconst b = a\nconst c = b') - expect(depGraph.get('c')).toEqual(new Set(['b'])) - expect(depGraph.get('b')).toEqual(new Set(['a'])) - expect(depGraph.get('a')).toEqual(new Set()) - }) -}) - -// ─── collectModuleLevelRefsFromNode ──────────────────────── - -describe('collectModuleLevelRefsFromNode', () => { - it('should find identifier reference in expression', () => { - const code = 'const x = 1\nconst y = x + 1' - const ast = parse(code) - const locals = new Set(['x', 'y']) - - const yDecl = ast.program.body[1] as t.VariableDeclaration - const valueNode = yDecl.declarations[0]!.init! - - const refs = collectModuleLevelRefsFromNode(valueNode, locals) - expect(refs).toContain('x') - expect(refs).not.toContain('y') - }) - - it('should return empty set when no local bindings referenced', () => { - const code = "import { foo } from './mod'\nconst x = foo()" - const ast = parse(code) - const locals = new Set(['x']) // foo is imported, not local - - const xDecl = ast.program.body[1] as t.VariableDeclaration - const valueNode = xDecl.declarations[0]!.init! - - const refs = collectModuleLevelRefsFromNode(valueNode, locals) - expect(refs.size).toBe(0) - }) - - it('should find multiple references', () => { - const code = 'const a = 1\nconst b = 2\nconst c = a + b' - const ast = parse(code) - const locals = new Set(['a', 'b', 'c']) - - const cDecl = ast.program.body[2] as t.VariableDeclaration - const valueNode = cDecl.declarations[0]!.init! - - const refs = collectModuleLevelRefsFromNode(valueNode, locals) - expect(refs).toContain('a') - expect(refs).toContain('b') - }) - - it('should find refs inside function call arguments', () => { - const code = 'const config = {}\nconst result = process(config)' - const ast = parse(code) - const locals = new Set(['config', 'result']) - - const resultDecl = ast.program.body[1] as t.VariableDeclaration - const valueNode = resultDecl.declarations[0]!.init! - - const refs = collectModuleLevelRefsFromNode(valueNode, locals) - expect(refs).toContain('config') - }) - - it('should only return direct refs (not transitive)', () => { - const code = 'const a = 1\nconst b = a\nconst c = b' - const ast = parse(code) - const locals = new Set(['a', 'b', 'c']) - - const cDecl = ast.program.body[2] as t.VariableDeclaration - const valueNode = cDecl.declarations[0]!.init! - - const refs = collectModuleLevelRefsFromNode(valueNode, locals) - // Only b is directly referenced, NOT a (transitive expansion is separate) - expect(refs).toContain('b') - expect(refs).not.toContain('a') - }) -}) - -// ─── expandTransitively ─────────────────────────────────── - -describe('expandTransitively', () => { - it('should expand shared set with deps of shared bindings', () => { - const { depGraph } = graphFromCode('const dep = 1\nconst shared = dep + 1') - const shared = new Set(['shared']) - - expandTransitively(shared, depGraph) - expect(shared).toContain('dep') - }) - - it('should handle multi-level transitive expansion', () => { - const { depGraph } = graphFromCode('const a = 1\nconst b = a\nconst c = b') - const shared = new Set(['c']) - - expandTransitively(shared, depGraph) - expect(shared).toContain('b') - expect(shared).toContain('a') - }) - - it('should not expand bindings not in graph', () => { - const depGraph = new Map>() - depGraph.set('shared', new Set(['ext'])) - // ext has no entry in graph - const shared = new Set(['shared']) - - expandTransitively(shared, depGraph) - // ext added because it's a dep, even if it has no graph entry - expect(shared).toContain('ext') - expect(shared.size).toBe(2) - }) - - it('should not loop on circular references', () => { - const { depGraph } = graphFromCode( - 'const a = () => b()\nconst b = () => a()', - ) - const shared = new Set(['a']) - - expandTransitively(shared, depGraph) - expect(shared).toContain('a') - expect(shared).toContain('b') - }) - - it('should leave shared untouched when binding has no deps', () => { - const depGraph = new Map>() - depGraph.set('x', new Set()) - const shared = new Set(['x']) - - expandTransitively(shared, depGraph) - expect(shared.size).toBe(1) - expect(shared).toContain('x') - }) - - it('should handle function declaration deps', () => { - const { depGraph } = graphFromCode( - 'const config = {}\nfunction init() { return config }', - ) - const shared = new Set(['init']) - - expandTransitively(shared, depGraph) - expect(shared).toContain('config') - }) - - it('should handle empty graph', () => { - const depGraph = new Map>() - const shared = new Set(['x']) - - expandTransitively(shared, depGraph) - expect(shared.size).toBe(1) - }) -}) - -// ─── expandDestructuredDeclarations ─────────────────────── - -describe('expandDestructuredDeclarations', () => { - it('should add all siblings when one destructured binding is shared', () => { - const ast = parse('const { a, b, c } = fn()') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('a') - expect(shared).toContain('b') - expect(shared).toContain('c') - }) - - it('should handle array destructuring', () => { - const ast = parse('const [x, y] = fn()') - const shared = new Set(['y']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('x') - expect(shared).toContain('y') - }) - - it('should not expand non-destructured declarations', () => { - const ast = parse('const a = 1\nconst b = 2') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('a') - expect(shared).not.toContain('b') - }) - - it('should handle exported destructured declarations', () => { - const ast = parse('export const { a, b } = fn()') - const shared = new Set(['b']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('a') - expect(shared).toContain('b') - }) - - it('should not touch declarations where no binding is shared', () => { - const ast = parse('const { a, b } = fn()\nconst { c, d } = other()') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('a') - expect(shared).toContain('b') - expect(shared).not.toContain('c') - expect(shared).not.toContain('d') - }) - - it('should handle nested destructuring', () => { - const ast = parse('const { a, b: { c } } = fn()') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('a') - expect(shared).toContain('c') - }) - - it('should handle destructuring with defaults', () => { - const ast = parse('const { a = 1, b = 2 } = fn()') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('b') - }) - - it('should handle destructuring with rest', () => { - const ast = parse('const { a, ...rest } = fn()') - const shared = new Set(['a']) - - expandDestructuredDeclarations(ast, shared) - expect(shared).toContain('rest') - }) -}) - -// ─── computeSharedBindings (integration) ────────────────── - describe('computeSharedBindings', () => { const defaultGroupings = defaultCodeSplitGroupings @@ -952,89 +411,3 @@ export const Route = createFileRoute('/mixed')({ }) // ─── removeBindingsDependingOnRoute ─────────────────────── - -describe('removeBindingsDependingOnRoute', () => { - it('should remove a binding that directly depends on Route', () => { - const depGraph = new Map>() - depGraph.set('helper', new Set(['Route'])) - depGraph.set('Route', new Set()) - const shared = new Set(['helper']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).not.toContain('helper') - }) - - it('should remove a binding that transitively depends on Route', () => { - const depGraph = new Map>() - depGraph.set('a', new Set(['b'])) - depGraph.set('b', new Set(['Route'])) - depGraph.set('Route', new Set()) - const shared = new Set(['a']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).not.toContain('a') - }) - - it('should keep a binding that does NOT depend on Route', () => { - const depGraph = new Map>() - depGraph.set('safe', new Set(['dep'])) - depGraph.set('dep', new Set()) - depGraph.set('Route', new Set()) - const shared = new Set(['safe']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).toContain('safe') - }) - - it('should handle mixed: remove Route-dependent, keep safe bindings', () => { - const depGraph = new Map>() - depGraph.set('safe', new Set(['dep'])) - depGraph.set('dep', new Set()) - depGraph.set('unsafe', new Set(['Route'])) - depGraph.set('Route', new Set()) - const shared = new Set(['safe', 'unsafe']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).toContain('safe') - expect(shared).not.toContain('unsafe') - }) - - it('should handle empty shared set', () => { - const depGraph = new Map>() - const shared = new Set() - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared.size).toBe(0) - }) - - it('should handle binding with no graph entry', () => { - const depGraph = new Map>() - const shared = new Set(['orphan']) - - removeBindingsDependingOnRoute(shared, depGraph) - // No deps found → does not depend on Route → keep - expect(shared).toContain('orphan') - }) - - it('should handle circular deps that do NOT reach Route', () => { - const depGraph = new Map>() - depGraph.set('a', new Set(['b'])) - depGraph.set('b', new Set(['a'])) - depGraph.set('Route', new Set()) - const shared = new Set(['a']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).toContain('a') - }) - - it('should handle circular deps that DO reach Route', () => { - const depGraph = new Map>() - depGraph.set('a', new Set(['b'])) - depGraph.set('b', new Set(['a', 'Route'])) - depGraph.set('Route', new Set()) - const shared = new Set(['a']) - - removeBindingsDependingOnRoute(shared, depGraph) - expect(shared).not.toContain('a') - }) -}) diff --git a/packages/router-plugin/tests/utils.test.ts b/packages/router-plugin/tests/utils.test.ts index 6812b59bc38..e8a93df7d46 100644 --- a/packages/router-plugin/tests/utils.test.ts +++ b/packages/router-plugin/tests/utils.test.ts @@ -1,6 +1,5 @@ -import * as babel from '@babel/core' -import * as t from '@babel/types' -import { parseAst } from '@tanstack/router-utils' +import { analyzeModule, parseExpression } from '@tanstack/router-utils' +import { is } from 'yuku-ast' import { describe, expect, it } from 'vitest' import { getObjectPropertyKeyName, @@ -8,7 +7,6 @@ import { normalizePath, routeFactoryCallCodeFilter, } from '../src/core/utils' -import type { NodePath } from '@babel/core' function matchesRouteFactoryCallCodeFilter(code: string) { return routeFactoryCallCodeFilter.some((pattern) => { @@ -18,22 +16,8 @@ function matchesRouteFactoryCallCodeFilter(code: string) { }) } -function getProgramPath(code: string): NodePath { - const ast = parseAst({ code }) - let programPath: NodePath | undefined - - babel.traverse(ast, { - Program(path: NodePath) { - programPath = path - path.stop() - }, - }) - - if (!programPath) { - throw new Error('Program path not found') - } - - return programPath +function getProgramPath(code: string) { + return analyzeModule({ code }).ast } describe('normalizePath', () => { @@ -142,38 +126,19 @@ describe('routeFactoryCallCodeFilter', () => { }) describe('getObjectPropertyKeyName', () => { - it('returns identifier keys', () => { - const prop = t.objectProperty(t.identifier('component'), t.identifier('x')) - - expect(getObjectPropertyKeyName(prop)).toBe('component') - }) - - it('returns string literal keys', () => { - const prop = t.objectProperty( - t.stringLiteral('errorComponent'), - t.identifier('x'), - ) - - expect(getObjectPropertyKeyName(prop)).toBe('errorComponent') - }) - - it('returns undefined for computed identifier keys', () => { - const prop = t.objectProperty( - t.identifier('component'), - t.identifier('x'), - true, - ) - - expect(getObjectPropertyKeyName(prop)).toBeUndefined() - }) - - it('returns undefined for computed member expression keys', () => { - const prop = t.objectProperty( - t.memberExpression(t.identifier('foo'), t.identifier('bar')), - t.identifier('x'), - true, - ) - - expect(getObjectPropertyKeyName(prop)).toBeUndefined() + it.each([ + ['component: x', 'component'], + ['"errorComponent": x', 'errorComponent'], + ['[component]: x', undefined], + ['[foo.bar]: x', undefined], + ])('reads static keys in %s', (source, expected) => { + const expression = parseExpression(`{${source}}`) + if ( + !is.ObjectExpression(expression) || + !is.Property(expression.properties[0]) + ) { + throw new Error('Expected an object property') + } + expect(getObjectPropertyKeyName(expression.properties[0])).toBe(expected) }) }) diff --git a/packages/router-utils/package.json b/packages/router-utils/package.json index fe7ce16b329..4be874c09eb 100644 --- a/packages/router-utils/package.json +++ b/packages/router-utils/package.json @@ -33,7 +33,7 @@ "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js", "test:types:ts60": "tsc6", "test:types:ts70": "tsc", - "test:unit": "exit 0; vitest --typecheck", + "test:unit": "vitest --typecheck", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build" }, @@ -63,17 +63,16 @@ "node": ">=20.19" }, "dependencies": { - "@babel/generator": "^7.29.8", - "@babel/parser": "^7.29.8", - "@babel/types": "catalog:", "ansis": "^4.3.1", - "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.4", "pathe": "catalog:", - "tinyglobby": "catalog:" + "tinyglobby": "catalog:", + "@yuku-toolchain/types": "0.11.0", + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0", + "yuku-codegen": "0.11.0" }, "devDependencies": { - "@types/babel__generator": "^7.27.0", "vite": "*", "@types/node": ">=20", "@tanstack/vite-config": "catalog:", diff --git a/packages/router-utils/src/ast.ts b/packages/router-utils/src/ast.ts index 46e319c2c4e..9432f3244e3 100644 --- a/packages/router-utils/src/ast.ts +++ b/packages/router-utils/src/ast.ts @@ -1,195 +1,171 @@ -import { parse } from '@babel/parser' -import _generate from '@babel/generator' -import * as t from '@babel/types' -import { - deadCodeElimination as _deadCodeElimination, - findReferencedIdentifiers, -} from 'babel-dead-code-elimination' -import type { GeneratorOptions, GeneratorResult } from '@babel/generator' -import type { ParseResult, ParserOptions } from '@babel/parser' -import type * as _babel_types from '@babel/types' +import { analyze } from 'yuku-analyzer' +import { generate } from 'yuku-codegen' +import { walk } from 'yuku-ast' +import type { Module, Symbol } from 'yuku-analyzer' +import type { Expression, Node, Program } from '@yuku-toolchain/types' +import type { GenerateResult as NativeGenerateResult } from 'yuku-codegen' + +export interface GenerateResult extends Omit { + map: { + version: number + names: Array + sources: Array + mappings: string + file?: string + sourceRoot?: string + sourcesContent?: Array + } | null +} -export type ParseAstOptions = ParserOptions & { +export interface AnalyzeModuleOptions { code: string filename?: string } -export type ParseAstResult = ParseResult<_babel_types.File> -export function parseAst({ +/** Parse and bind once. Treat this module's AST as the immutable source model. */ +export function analyzeModule({ code, - filename, - sourceFilename, - plugins, - ...opts -}: ParseAstOptions): ParseAstResult { - const inferredFilename = filename ?? sourceFilename - return parse(code, { - plugins: plugins ?? getDefaultParserPluginsForFilename(inferredFilename), + filename = 'input.tsx', +}: AnalyzeModuleOptions): Module { + const physicalName = filename.replace(/[?#].*$/, '') + const module = analyze(code, { + path: filename, + lang: /\.[cm]?ts$/.test(physicalName) ? 'ts' : 'tsx', sourceType: 'module', - sourceFilename, - ...opts, + attachComments: true, }) -} - -function getDefaultParserPluginsForFilename( - filename: string | undefined, -): NonNullable { - const plugins: NonNullable = [ - 'typescript', - 'explicitResourceManagement', - 'importAttributes', - 'deprecatedImportAssert', - ['decorators', { decoratorsBeforeExport: true }], - 'decoratorAutoAccessors', - ] - - if (!isPlainTypeScriptFile(filename)) { - plugins.unshift('jsx') + const error = module.diagnostics.find( + (diagnostic) => diagnostic.severity === 'error', + ) + if (error) { + throw new SyntaxError(`${filename}: ${error.message} (at ${error.start})`) } - - return plugins + return module } -function isPlainTypeScriptFile(filename: string | undefined): boolean { - if (!filename) { - return false +/** Print an output tree without modifying the source model or its semantic tables. */ +export function generateModule( + program: Program, + options?: { source: string; filename: string }, +): GenerateResult { + const result = generate(program, { + comments: 'all', + ...(options + ? { + sourceMap: { + source: options.source, + sourceFileName: options.filename, + sourcesContent: options.source, + }, + } + : {}), + }) + if (result.errors.length) { + throw new Error(result.errors.map((error) => error.message).join('\n')) + } + return { + ...result, + map: result.map + ? { + version: result.map.version, + names: result.map.names, + sources: result.map.sources, + mappings: result.map.mappings, + ...(result.map.file === null ? {} : { file: result.map.file }), + ...(result.map.sourceRoot === null + ? {} + : { sourceRoot: result.map.sourceRoot }), + ...(result.map.sourcesContent === null + ? {} + : { sourcesContent: result.map.sourcesContent }), + } + : null, } - - return /\.[cm]?ts(?:$|[?#])/.test(filename) } -let generate = _generate - -if ('default' in generate) { - generate = generate.default as typeof generate -} -type GenerateFromAstOptions = GeneratorOptions & - Required> -export function generateFromAst( - ast: _babel_types.Node, - opts?: GenerateFromAstOptions, -): GeneratorResult { - return generate( - ast, - opts - ? { importAttributesKeyword: 'with', sourceMaps: true, ...opts } - : undefined, - ) +export interface ModuleAstClone { + program: Program + /** Resolve surviving copied nodes against the original semantic snapshot. */ + originalNodes: WeakMap } -export type { GeneratorResult } from '@babel/generator' -/** - * Strips TypeScript type-only exports and imports from an AST. - * - * This is necessary because babel-dead-code-elimination doesn't handle - * TypeScript type exports/imports. When a type export references an import - * that pulls in server-only code, the dead code elimination won't remove - * that import because it sees the type as still referencing it. - * - * This function removes: - * - `export type Foo = ...` - * - `export interface Foo { ... }` - * - `export type { Foo } from './module'` - * - `export type * from './module'` - * - Type specifiers in mixed exports: `export { value, type Foo }` -> `export { value }` - * - `import type { Foo } from './module'` - * - Type specifiers in mixed imports: `import { value, type Foo } from './module'` -> `import { value }` - * - * Note: Non-exported type/interface declarations are preserved as they may be - * used as type annotations within the code. - * - * @param ast - The Babel AST (or ParseResult) to mutate - */ -export function stripTypeExports(ast: ParseResult<_babel_types.File>): void { - // Filter the program body to remove type-only nodes - ast.program.body = ast.program.body.filter((node) => { - // Handle export declarations - if (t.isExportNamedDeclaration(node)) { - // Remove entire export if it's a type-only export - // e.g., `export type Foo = string`, `export interface Bar {}`, `export type { X } from './y'` - if (node.exportKind === 'type') { - return false - } +export function cloneModuleAst(module: Module): ModuleAstClone { + const program = structuredClone(module.ast) + const originals: Array = [] + walk(module.ast, { + enter(node) { + originals.push(node) + }, + }) + const originalNodes = new WeakMap() + let index = 0 + walk(program, { + enter(node) { + originalNodes.set(node, originals[index++]!) + }, + }) + return { program, originalNodes } +} - // For value exports with mixed specifiers, filter out type-only specifiers - // e.g., `export { value, type TypeOnly }` -> `export { value }` - if (node.specifiers.length > 0) { - node.specifiers = node.specifiers.filter((specifier) => { - if (t.isExportSpecifier(specifier)) { - return specifier.exportKind !== 'type' - } - return true - }) +const generatedReferences = new WeakMap() - // If all specifiers were removed, remove the entire export declaration - // (unless it has a declaration like `export const x = 1`) - if (node.specifiers.length === 0 && !node.declaration) { - return false - } - } - } +/** Explicitly connect a new reference to a source binding; never infer local scope. */ +export function linkGeneratedReference( + node: T, + reference: Symbol | string, +): T { + generatedReferences.set(node, reference) + return node +} - // Handle type-only export-all declarations - // e.g., `export type * from './module'` - if (t.isExportAllDeclaration(node)) { - if (node.exportKind === 'type') { - return false - } - } +export function generatedReferenceOf(node: Node): Symbol | string | undefined { + return generatedReferences.get(node) +} - // Handle import declarations - if (t.isImportDeclaration(node)) { - // Remove entire import if it's a type-only import - // e.g., `import type { Foo } from './module'` - if (node.importKind === 'type') { - return false +/** Copy a generated fragment without dropping its native reference provenance. */ +export function cloneGeneratedNode(node: T): T { + const copy = structuredClone(node) + const originals: Array = [] + walk(node, { + enter(original) { + originals.push(original) + }, + }) + let index = 0 + walk(copy, { + enter(current) { + const reference = generatedReferences.get(originals[index++]!) + if (reference) { + generatedReferences.set(current, reference) } + }, + }) + return copy +} - // For value imports with mixed specifiers, filter out type-only specifiers - // e.g., `import { value, type TypeOnly } from './module'` -> `import { value }` - if (node.specifiers.length > 0) { - node.specifiers = node.specifiers.filter((specifier) => { - if (t.isImportSpecifier(specifier)) { - return specifier.importKind !== 'type' - } - return true - }) - - // If all specifiers were removed, remove the entire import declaration - if (node.specifiers.length === 0) { - return false - } - } +/** Parse compiler-owned snippets; their nodes have no original-source spans. */ +export function parseStatements(code: string): Program['body'] { + const module = analyzeModule({ code, filename: 'generated.tsx' }) + for (const reference of module.unresolvedReferences) { + if (!reference.inTypePosition) { + generatedReferences.set(reference.node, reference.name) } - - return true + } + walk(module.ast, { + enter(node) { + node.start = 0 + node.end = 0 + }, }) + return module.ast.body } -// Re-export findReferencedIdentifiers from babel-dead-code-elimination -export { findReferencedIdentifiers } - -/** - * Performs dead code elimination on the AST, with TypeScript type stripping. - * - * This is a wrapper around babel-dead-code-elimination that first strips - * TypeScript type-only exports and imports. This is necessary because - * babel-dead-code-elimination doesn't handle type exports, which can cause - * imports to be retained when they're only referenced by type exports. - * - * @param ast - The Babel AST to mutate - * @param candidates - Optional set of identifier paths to consider for removal. - * If provided, only these identifiers will be candidates for removal. - * This should be the result of `findReferencedIdentifiers(ast)` called - * before any AST transformations. - */ -export function deadCodeElimination( - ast: ParseResult<_babel_types.File>, - candidates?: ReturnType, -): void { - // First strip TypeScript type-only exports and imports - stripTypeExports(ast) - - // Then run the original dead code elimination - _deadCodeElimination(ast, candidates) +export function parseExpression(code: string): Expression { + const statement = parseStatements(`(${code});`)[0] + if (statement?.type !== 'ExpressionStatement') { + throw new Error('Expected an expression') + } + return statement.expression.type === 'ParenthesizedExpression' + ? statement.expression.expression + : statement.expression } diff --git a/packages/router-utils/src/compiler-helpers.ts b/packages/router-utils/src/compiler-helpers.ts index 5460c349141..684b3107ede 100644 --- a/packages/router-utils/src/compiler-helpers.ts +++ b/packages/router-utils/src/compiler-helpers.ts @@ -1,902 +1,483 @@ -import * as t from '@babel/types' - -type CompilerNodePath = { - node: TNode - parentPath: CompilerNodePath | null - isVariableDeclarator: () => boolean -} - -type ReplacePathNode = Omit & { - node: TNode -} - -type IdentifierScopeFrame = { - kind: 'program' | 'function' | 'block' - bindings: Set +import { bindingIdentifiers, is, nameOf, walk } from 'yuku-ast' +import { generatedReferenceOf } from './ast' +import type { Module, Scope, Symbol } from 'yuku-analyzer' +import type { Expression, Node, Program } from '@yuku-toolchain/types' + +export interface ModuleDeclarationGraph { + declarations: Map + dependencies: Map> + declarationSymbols: Map> +} + +/** Runtime references resolved by Yuku, including JSX and excluding shadowed names. */ +export function collectModuleReferences( + module: Module, + node: Node, +): Set { + const references = new Set() + module.walk( + { + enter(current) { + const reference = module.referenceOf(current) + if ( + reference && + !reference.inTypePosition && + reference.symbol?.scope === module.rootScope + ) { + references.add(reference.symbol) + } + }, + }, + node, + ) + return references } -type IdentifierScopeStack = Array -export type ModuleInfoBinding = - | { - type: 'import' - source: string - importedName: string +function declarationOf(module: Module, identifier: Node): Node | undefined { + let current: Node | null = identifier + while (current) { + if (is.VariableDeclarator(current)) { + const statement = module.parentOf(current) + const parent = statement && module.parentOf(statement) + if ( + is.ForInStatement(parent) || + is.ForOfStatement(parent) || + is.ForStatement(parent) + ) { + return undefined + } + return current } - | { - type: 'var' - init: t.Expression | null + if (is.TSEnumDeclaration(current) || is.TSModuleDeclaration(current)) { + return current.id === identifier ? current : undefined } - -export interface ExtractedModuleInfo { - bindings: Map - exports: Map - reExportAllSources: Array -} - -function getTransparentWrapperExpression(node: t.Node): t.Expression | null { - if ( - t.isTSAsExpression(node) || - t.isTSSatisfiesExpression(node) || - t.isTSTypeAssertion(node) || - t.isTSNonNullExpression(node) || - t.isParenthesizedExpression(node) - ) { - return node.expression - } - - return null -} - -export function unwrapExpression(expr: t.Expression): t.Expression { - let inner = getTransparentWrapperExpression(expr) - while (inner) { - expr = inner - inner = getTransparentWrapperExpression(expr) - } - - return expr -} - -export function getVariableDeclaratorForExpressionPath< - TPath extends CompilerNodePath, ->(path: TPath): ReplacePathNode | null { - let currentPath: CompilerNodePath = path - let parentPath = currentPath.parentPath - - while ( - parentPath && - getTransparentWrapperExpression(parentPath.node) === currentPath.node - ) { - currentPath = parentPath - parentPath = parentPath.parentPath - } - - if ( - parentPath?.isVariableDeclarator() && - t.isVariableDeclarator(parentPath.node) && - parentPath.node.init === currentPath.node - ) { - return parentPath as ReplacePathNode - } - - return null -} - -function getModuleExportName(node: t.Identifier | t.StringLiteral) { - return t.isIdentifier(node) ? node.name : node.value -} - -function addVariableDeclarationModuleInfo( - declaration: t.VariableDeclaration, - bindings: Map, - exportMap?: Map, -) { - for (const declarator of declaration.declarations) { - for (const name of collectIdentifiersFromPattern(declarator.id)) { - bindings.set(name, { - type: 'var', - init: declarator.init ?? null, - }) - exportMap?.set(name, name) - } - } -} - -function addDeclarationModuleInfo( - declaration: t.Declaration, - bindings: Map, - exportMap?: Map, -) { - if (t.isVariableDeclaration(declaration)) { - addVariableDeclarationModuleInfo(declaration, bindings, exportMap) - return - } - - if ( - (t.isFunctionDeclaration(declaration) || - t.isClassDeclaration(declaration)) && - declaration.id - ) { - bindings.set(declaration.id.name, { - type: 'var', - init: null, - }) - exportMap?.set(declaration.id.name, declaration.id.name) - } -} - -function hasIdentifierBinding(scopes: IdentifierScopeStack, name: string) { - for (let i = scopes.length - 1; i >= 0; i--) { - if (scopes[i]!.bindings.has(name)) { - return true + if ( + is.FunctionDeclaration(current) || + is.ClassDeclaration(current) || + is.TSDeclareFunction(current) + ) { + return current.id === identifier ? current : undefined } - } - return false -} - -function currentIdentifierScope(scopes: IdentifierScopeStack) { - return scopes[scopes.length - 1]! -} - -function nearestFunctionIdentifierScope(scopes: IdentifierScopeStack) { - for (let i = scopes.length - 1; i >= 0; i--) { - const scope = scopes[i]! - if (scope.kind === 'function' || scope.kind === 'program') { - return scope + if ( + is.ImportSpecifier(current) || + is.ImportDefaultSpecifier(current) || + is.ImportNamespaceSpecifier(current) + ) { + return current } - } - return currentIdentifierScope(scopes) -} - -function addIdentifierPatternBindings( - pattern: t.LVal | t.Node | null | undefined, - scope: IdentifierScopeFrame, -) { - for (const name of collectIdentifiersFromPattern(pattern)) { - scope.bindings.add(name) - } -} - -function addIdentifierDeclarationBindings( - declaration: t.Node, - scopes: IdentifierScopeStack, -) { - if (t.isVariableDeclaration(declaration)) { - const scope = - declaration.kind === 'var' - ? nearestFunctionIdentifierScope(scopes) - : currentIdentifierScope(scopes) - for (const declarator of declaration.declarations) { - addIdentifierPatternBindings(declarator.id, scope) + if (is.Function(current) || is.Class(current) || is.Program(current)) { + return undefined } - return - } - - if ( - (t.isFunctionDeclaration(declaration) || - t.isClassDeclaration(declaration) || - t.isTSTypeAliasDeclaration(declaration) || - t.isTSInterfaceDeclaration(declaration) || - t.isTSEnumDeclaration(declaration)) && - declaration.id - ) { - currentIdentifierScope(scopes).bindings.add(declaration.id.name) - } -} - -function addIdentifierImportBindings( - node: t.ImportDeclaration, - scope: IdentifierScopeFrame, -) { - for (const specifier of node.specifiers) { - scope.bindings.add(specifier.local.name) + current = module.parentOf(current) } + return undefined } -function createNestedIdentifierScope( - kind: IdentifierScopeFrame['kind'], - scopes: IdentifierScopeStack, -): IdentifierScopeStack { - return [...scopes, { kind, bindings: new Set() }] -} - -function addIdentifierBlockBindings( - body: Array, - scopes: IdentifierScopeStack, -) { - for (const statement of body) { - if (t.isImportDeclaration(statement)) { - addIdentifierImportBindings(statement, currentIdentifierScope(scopes)) - } else if (t.isExportNamedDeclaration(statement) && statement.declaration) { - addIdentifierDeclarationBindings(statement.declaration, scopes) - } else { - addIdentifierDeclarationBindings(statement, scopes) +function declarationIndex( + module: Module, + symbols: Array, +): Pick { + const declarations = new Map() + const declarationSymbols = new Map>() + for (const symbol of symbols) { + for (const identifier of symbol.declarations) { + const declaration = declarationOf(module, identifier) + if (!declaration) { + continue + } + const previous = declarations.get(symbol) + if ( + !previous || + (is.TSDeclareFunction(previous) && !is.TSDeclareFunction(declaration)) + ) { + declarations.set(symbol, declaration) + } + const siblings = declarationSymbols.get(declaration) ?? new Set() + siblings.add(symbol) + declarationSymbols.set(declaration, siblings) } } + return { declarations, declarationSymbols } } -function walkIdentifierChildren( - current: t.Node, - parent: t.Node | undefined, - scopes: IdentifierScopeStack, - ids: Set, -) { - for (const key of t.VISITOR_KEYS[current.type] ?? []) { - const child = (current as any)[key] - if (Array.isArray(child)) { - for (const item of child) { - if (item && typeof item.type === 'string') { - walkIdentifierNode(item, current, parent, key, scopes, ids) +/** Bindings sharing a declarator are one initialization unit. */ +export function moduleDeclarationGraph(module: Module): ModuleDeclarationGraph { + const index = declarationIndex(module, module.rootScope.bindings) + const dependencies = new Map>() + for (const [declaration, owners] of index.declarationSymbols) { + const references = collectModuleReferences(module, declaration) + for (const symbol of owners) { + const combined = dependencies.get(symbol) ?? new Set() + for (const reference of references) { + if (reference !== symbol) { + combined.add(reference) } } - } else if (child && typeof child.type === 'string') { - walkIdentifierNode(child, current, parent, key, scopes, ids) + dependencies.set(symbol, combined) } } + return { ...index, dependencies } } -function walkIdentifierNode( - current: t.Node | null | undefined, - parent: t.Node | undefined, - grandparent: t.Node | undefined, - parentKey: string | undefined, - scopes: IdentifierScopeStack, - ids: Set, -) { - if (!current) return - - if (t.isIdentifier(current)) { - if ( - (!parent || t.isReferenced(current, parent, grandparent)) && - !hasIdentifierBinding(scopes, current.name) - ) { - ids.add(current.name) +export function expandTransitively( + roots: Set, + dependencies: Map>, +): Set { + const expanded = new Set(roots) + for (const item of expanded) { + for (const dependency of dependencies.get(item) ?? []) { + expanded.add(dependency) } - return } + return expanded +} - if (t.isJSXIdentifier(current)) { - if (parent && t.isJSXAttribute(parent) && parentKey === 'name') { - return - } - - if (parent && t.isJSXMemberExpression(parent) && parentKey === 'property') { - return - } - - const first = current.name[0] - if (first && first === first.toLowerCase()) { - return - } - - if (!hasIdentifierBinding(scopes, current.name)) { - ids.add(current.name) - } - return - } - - if (t.isProgram(current)) { - const nestedScopes = createNestedIdentifierScope('program', scopes) - addIdentifierBlockBindings(current.body, nestedScopes) - for (const child of current.body) { - walkIdentifierNode(child, current, parent, 'body', nestedScopes, ids) - } - return - } - - if (t.isBlockStatement(current)) { - const nestedScopes = createNestedIdentifierScope('block', scopes) - addIdentifierBlockBindings(current.body, nestedScopes) - for (const child of current.body) { - walkIdentifierNode(child, current, parent, 'body', nestedScopes, ids) - } - return - } - - if ( - t.isFunctionDeclaration(current) || - t.isFunctionExpression(current) || - t.isArrowFunctionExpression(current) || - t.isObjectMethod(current) || - t.isClassMethod(current) || - t.isClassPrivateMethod(current) - ) { - if (t.isFunctionDeclaration(current) && current.id) { - currentIdentifierScope(scopes).bindings.add(current.id.name) - } - - const nestedScopes = createNestedIdentifierScope('function', scopes) - if ( - (t.isFunctionDeclaration(current) || t.isFunctionExpression(current)) && - current.id - ) { - currentIdentifierScope(nestedScopes).bindings.add(current.id.name) +/** Erase imports/exports that exist only in TypeScript's type space. */ +export function stripTypeExports(program: Program): void { + program.body = program.body.filter((statement) => { + if (is.ImportDeclaration(statement)) { + if (statement.importKind === 'type') { + return false + } + const hadSpecifiers = statement.specifiers.length > 0 + statement.specifiers = statement.specifiers.filter( + (specifier) => + !is.ImportSpecifier(specifier) || specifier.importKind !== 'type', + ) + return !hadSpecifiers || statement.specifiers.length > 0 } - for (const param of current.params) { - addIdentifierPatternBindings(param, currentIdentifierScope(nestedScopes)) + if (is.ExportAllDeclaration(statement)) { + return statement.exportKind !== 'type' } - - walkIdentifierChildren(current, parent, nestedScopes, ids) - return - } - - if (t.isCatchClause(current)) { - const nestedScopes = createNestedIdentifierScope('block', scopes) - addIdentifierPatternBindings( - current.param, - currentIdentifierScope(nestedScopes), - ) - walkIdentifierNode( - current.param, - current, - parent, - 'param', - nestedScopes, - ids, - ) - walkIdentifierNode(current.body, current, parent, 'body', nestedScopes, ids) - return - } - - if (t.isImportDeclaration(current)) { - addIdentifierImportBindings(current, currentIdentifierScope(scopes)) - return - } - - if (t.isClassDeclaration(current) || t.isClassExpression(current)) { - if (t.isClassDeclaration(current) && current.id) { - currentIdentifierScope(scopes).bindings.add(current.id.name) - } - - const nestedScopes = current.id - ? createNestedIdentifierScope('block', scopes) - : scopes - if (current.id) { - currentIdentifierScope(nestedScopes).bindings.add(current.id.name) + if (is.ExportNamedDeclaration(statement)) { + if ( + statement.exportKind === 'type' || + is.TSInterfaceDeclaration(statement.declaration) || + is.TSTypeAliasDeclaration(statement.declaration) + ) { + return false + } + const hadSpecifiers = statement.specifiers.length > 0 + statement.specifiers = statement.specifiers.filter( + (specifier) => specifier.exportKind !== 'type', + ) + return ( + !!statement.declaration || + !hadSpecifiers || + statement.specifiers.length > 0 + ) } + return true + }) +} - walkIdentifierChildren(current, parent, nestedScopes, ids) - return - } - - if (t.isVariableDeclaration(current)) { - addIdentifierDeclarationBindings(current, scopes) - } else if (t.isVariableDeclarator(current)) { - const scope = - parent && t.isVariableDeclaration(parent) && parent.kind === 'var' - ? nearestFunctionIdentifierScope(scopes) - : currentIdentifierScope(scopes) - addIdentifierPatternBindings(current.id, scope) - } else if ( - t.isTSTypeAliasDeclaration(current) || - t.isTSInterfaceDeclaration(current) || - t.isTSEnumDeclaration(current) - ) { - currentIdentifierScope(scopes).bindings.add(current.id.name) - } - - walkIdentifierChildren(current, parent, scopes, ids) +export interface RemoveUnusedBindingsOptions { + roots?: Iterable + /** Preserve user declarations that were unused before the transform. */ + preserveInitiallyUnused?: boolean } /** - * Recursively walk an AST node and collect referenced identifier-like names. - * This avoids Babel path/scope allocation for module-level dependency scans. + * Rebuild liveness from surviving nodes, using original symbol identity. This + * removes dependencies of erased route options without reparsing generated code. + * Callers decide output ownership before invoking this lexical binding cleanup. */ -export function collectIdentifiersFromNode(node: t.Node): Set { - const ids = new Set() - walkIdentifierNode( - node, - undefined, - undefined, - undefined, - [{ kind: 'program', bindings: new Set() }], - ids, +export function removeUnusedBindings( + module: Module, + program: Program, + originalNodes: WeakMap, + { + roots = [], + preserveInitiallyUnused = true, + }: RemoveUnusedBindingsOptions = {}, +): void { + stripTypeExports(program) + const graph = declarationIndex(module, module.symbols) + const byName = new Map( + module.rootScope.bindings.map((symbol) => [symbol.name, symbol]), ) - return ids -} - -export function collectIdentifiersFromPattern( - node: t.LVal | t.Node | null | undefined, -): Array { - if (!node) { - return [] - } - - if (t.isIdentifier(node)) { - return [node.name] - } - - if (t.isAssignmentPattern(node)) { - return collectIdentifiersFromPattern(node.left) - } - - if (t.isRestElement(node)) { - return collectIdentifiersFromPattern(node.argument) - } - - if (t.isObjectPattern(node)) { - return node.properties.flatMap((prop) => { - if (t.isObjectProperty(prop)) { - return collectIdentifiersFromPattern(prop.value as t.LVal) - } - if (t.isRestElement(prop)) { - return collectIdentifiersFromPattern(prop.argument) - } - return [] - }) - } - - if (t.isArrayPattern(node)) { - return node.elements.flatMap((element) => - collectIdentifiersFromPattern(element), - ) - } - - return [] -} - -export function collectLocalBindingsFromStatement( - node: t.Statement | t.ModuleDeclaration, - bindings: Set, -) { - const declaration = - t.isExportNamedDeclaration(node) && node.declaration - ? node.declaration - : t.isExportDefaultDeclaration(node) - ? node.declaration - : node - - if (t.isVariableDeclaration(declaration)) { - for (const declarator of declaration.declarations) { - for (const name of collectIdentifiersFromPattern(declarator.id)) { - bindings.add(name) - } - } - } else if (t.isFunctionDeclaration(declaration) && declaration.id) { - bindings.add(declaration.id.name) - } else if (t.isClassDeclaration(declaration) && declaration.id) { - bindings.add(declaration.id.name) - } -} - -export function extractModuleInfoFromAst(ast: t.File): ExtractedModuleInfo { - const bindings = new Map() - const exportMap = new Map() - const reExportAllSources: Array = [] - - for (const node of ast.program.body) { - if (t.isImportDeclaration(node)) { - const source = node.source.value - for (const specifier of node.specifiers) { - if (t.isImportSpecifier(specifier)) { - bindings.set(specifier.local.name, { - type: 'import', - source, - importedName: getModuleExportName(specifier.imported), - }) - } else if (t.isImportDefaultSpecifier(specifier)) { - bindings.set(specifier.local.name, { - type: 'import', - source, - importedName: 'default', - }) - } else if (t.isImportNamespaceSpecifier(specifier)) { - bindings.set(specifier.local.name, { - type: 'import', - source, - importedName: '*', - }) + const originalOwners = new Map>(graph.declarationSymbols) + // Export records are uses even when there are no lexical references. A + // transform that removes an export may also remove its declaration graph. + const { exports: originalExports } = module + const originallyExported = new Set( + originalExports + .filter((record) => !record.typeOnly && record.local) + .map((record) => record.local), + ) + const live = new Set() + const dependencies = new Map>() + const present = new Set() + const ownerStack: Array | null> = [] + const scopeStack: Array = [] + const addDependency = (from: Symbol, to: Symbol) => { + const edges = dependencies.get(from) ?? new Set() + edges.add(to) + dependencies.set(from, edges) + } + for (const root of roots) { + const symbol = typeof root === 'string' ? byName.get(root) : root + if (symbol) { + live.add(symbol) + } + } + walk(program, { + enter(node) { + const original = originalNodes.get(node) + const own = original ? originalOwners.get(original) : undefined + const parentOwner = ownerStack.at(-1) ?? null + const owner = own ?? parentOwner + ownerStack.push(owner) + const scope = original + ? module.scopeOf(original) + : (scopeStack.at(-1) ?? module.rootScope) + scopeStack.push(scope) + if (own) { + for (const symbol of own) { + present.add(symbol) + if ( + preserveInitiallyUnused && + symbol.references.length === 0 && + !originallyExported.has(symbol) + ) { + if (parentOwner) { + for (const parent of parentOwner) { + addDependency(parent, symbol) + } + } else { + live.add(symbol) + } + } + for (const parent of parentOwner ?? []) { + addDependency(symbol, parent) + } } } - continue - } - - if (t.isVariableDeclaration(node)) { - addVariableDeclarationModuleInfo(node, bindings) - continue - } - - if (t.isFunctionDeclaration(node) || t.isClassDeclaration(node)) { - addDeclarationModuleInfo(node, bindings) - continue - } - - if (t.isExportNamedDeclaration(node)) { - if (node.declaration) { - addDeclarationModuleInfo(node.declaration, bindings, exportMap) - } - - for (const specifier of node.specifiers) { - if (t.isExportNamespaceSpecifier(specifier)) { - const exported = getModuleExportName(specifier.exported) - exportMap.set(exported, exported) - if (node.source) { - bindings.set(exported, { - type: 'import', - source: node.source.value, - importedName: '*', - }) + const markExport = (identifier: Node) => { + const originalIdentifier = originalNodes.get(identifier) + const symbol = originalIdentifier + ? module.symbolOf(originalIdentifier) + : byName.get(nameOf(identifier) ?? '') + if (!symbol) { + return + } + if (owner) { + for (const parent of owner) { + addDependency(parent, symbol) } - } else if (t.isExportSpecifier(specifier)) { - const local = getModuleExportName(specifier.local) - const exported = getModuleExportName(specifier.exported) - exportMap.set(exported, local) - - if (node.source) { - bindings.set(local, { - type: 'import', - source: node.source.value, - importedName: local, - }) + } else { + live.add(symbol) + } + } + if (is.ExportNamedDeclaration(node) && node.declaration) { + const declaration = node.declaration + if (is.VariableDeclaration(declaration)) { + for (const item of declaration.declarations) { + for (const identifier of bindingIdentifiers(item.id)) { + markExport(identifier) + } } + } else if ('id' in declaration && declaration.id) { + markExport(declaration.id) } } - continue - } - - if (t.isExportDefaultDeclaration(node)) { - const declaration = node.declaration - if (t.isIdentifier(declaration)) { - exportMap.set('default', declaration.name) - } else if ( - (t.isFunctionDeclaration(declaration) || - t.isClassDeclaration(declaration)) && - declaration.id + if ( + is.ExportDefaultDeclaration(node) && + (is.FunctionDeclaration(node.declaration) || + is.ClassDeclaration(node.declaration)) && + node.declaration.id ) { - bindings.set(declaration.id.name, { - type: 'var', - init: null, - }) - exportMap.set('default', declaration.id.name) + markExport(node.declaration.id) + } + if (is.ExportSpecifier(node)) { + markExport(node.local) + } + const reference = original ? module.referenceOf(original) : null + let symbol = + reference && !reference.inTypePosition ? reference.symbol : null + const generated = generatedReferenceOf(node) + if (!original && generated) { + symbol = + typeof generated === 'string' + ? module.resolve(generated, scope) + : generated + } + if (!symbol || !graph.declarations.has(symbol)) { + return + } + if (!owner) { + live.add(symbol) } else { - const synth = '__default_export__' - bindings.set(synth, { - type: 'var', - init: t.isExpression(declaration) ? declaration : null, - }) - exportMap.set('default', synth) + for (const source of owner) { + const edges = dependencies.get(source) ?? new Set() + edges.add(symbol) + dependencies.set(source, edges) + } } + }, + leave() { + ownerStack.pop() + scopeStack.pop() + }, + }) + // Destructuring must initialize once in its entirety if any sibling is live. + for (const siblings of graph.declarationSymbols.values()) { + const representative = siblings.values().next().value + if (!representative) { continue } - - if (t.isExportAllDeclaration(node)) { - reExportAllSources.push(node.source.value) - } - } - - return { - bindings, - exports: exportMap, - reExportAllSources, - } -} - -export function buildDeclarationMap(ast: t.File): Map { - const map = new Map() - - for (const statement of ast.program.body) { - const declaration = - t.isExportNamedDeclaration(statement) && statement.declaration - ? statement.declaration - : t.isExportDefaultDeclaration(statement) - ? statement.declaration - : statement - - if (t.isVariableDeclaration(declaration)) { - for (const declarator of declaration.declarations) { - for (const name of collectIdentifiersFromPattern(declarator.id)) { - map.set(name, declarator) - } + for (const symbol of siblings) { + if (symbol !== representative) { + addDependency(representative, symbol) + addDependency(symbol, representative) } - } else if (t.isFunctionDeclaration(declaration) && declaration.id) { - map.set(declaration.id.name, declaration) - } else if (t.isClassDeclaration(declaration) && declaration.id) { - map.set(declaration.id.name, declaration) } } - - return map -} - -export function buildDependencyGraph( - declarationMap: Map, - localBindings: Set, -): Map> { - const graph = new Map>() - - for (const [name, declarationNode] of declarationMap) { - if (!localBindings.has(name)) continue - - const dependencies = new Set() - for (const id of collectIdentifiersFromNode(declarationNode)) { - if (id !== name && localBindings.has(id)) { - dependencies.add(id) - } - } - graph.set(name, dependencies) - } - - return graph -} - -export function collectModuleLevelRefsFromNode( - node: t.Node, - localModuleLevelBindings: Set, -): Set { - const refs = new Set() - - for (const name of collectIdentifiersFromNode(node)) { - if (localModuleLevelBindings.has(name)) { - refs.add(name) - } - } - - return refs -} - -export function expandTransitively( - bindings: Set, - dependencyGraph: Map>, -) { - const queue = [...bindings] - const visited = new Set() - - while (queue.length > 0) { - const name = queue.pop()! - if (visited.has(name)) continue - visited.add(name) - - const dependencies = dependencyGraph.get(name) - if (!dependencies) continue - - for (const dependency of dependencies) { - if (!bindings.has(dependency)) { - bindings.add(dependency) - queue.push(dependency) + const retained = expandTransitively(live, dependencies) + const removable = new Set( + [...present].filter((symbol) => !retained.has(symbol)), + ) + walk(program, { + enter(node, context) { + const original = originalNodes.get(node) + const owners = original ? originalOwners.get(original) : undefined + if (owners && [...owners].every((symbol) => removable.has(symbol))) { + context.remove() } - } - } -} - -export function expandSharedDestructuredDeclarators( - ast: t.File, - refsByGroup: Map>, - sharedBindings: Set, -) { - for (const statement of ast.program.body) { - const declaration = - t.isExportNamedDeclaration(statement) && statement.declaration - ? statement.declaration - : statement - - if (!t.isVariableDeclaration(declaration)) continue - - for (const declarator of declaration.declarations) { - if ( - !t.isObjectPattern(declarator.id) && - !t.isArrayPattern(declarator.id) + }, + leave(node, context) { + if (is.VariableDeclaration(node) && node.declarations.length === 0) { + context.remove() + } else if (is.ImportDeclaration(node) && node.specifiers.length === 0) { + const original = originalNodes.get(node) + if ( + original && + is.ImportDeclaration(original) && + original.specifiers.length > 0 + ) { + context.remove() + } + } else if ( + is.ExportNamedDeclaration(node) && + !node.declaration && + node.specifiers.length === 0 && + !node.source ) { - continue + context.remove() } + }, + }) - const names = collectIdentifiersFromPattern(declarator.id) - const usedGroups = new Set() - - for (const name of names) { - const groups = refsByGroup.get(name) - if (!groups) continue - for (const group of groups) { - usedGroups.add(group) + const referencedNames = new Set() + walk(program, { + enter(node) { + const original = originalNodes.get(node) + if (original) { + const reference = module.referenceOf(original) + if (reference && !reference.inTypePosition) { + referencedNames.add(reference.name) } - } - - if (usedGroups.size >= 2) { - for (const name of names) { - sharedBindings.add(name) + } else { + const generated = generatedReferenceOf(node) + if (generated) { + referencedNames.add( + typeof generated === 'string' ? generated : generated.name, + ) } } + }, + }) + program.body = program.body.filter((statement) => { + if ( + !is.ImportDeclaration(statement) || + originalNodes.has(statement) || + statement.specifiers.length === 0 + ) { + return true } - } + statement.specifiers = statement.specifiers.filter((specifier) => + referencedNames.has(specifier.local.name), + ) + return statement.specifiers.length > 0 + }) } -export function expandDestructuredDeclarations( - ast: t.File, - bindings: Set, -) { - for (const statement of ast.program.body) { - const declaration = - t.isExportNamedDeclaration(statement) && statement.declaration - ? statement.declaration - : statement - - if (!t.isVariableDeclaration(declaration)) continue - - for (const declarator of declaration.declarations) { - if ( - !t.isObjectPattern(declarator.id) && - !t.isArrayPattern(declarator.id) - ) { - continue - } +export type ModuleInfoBinding = + | { type: 'import'; source: string; importedName: string } + | { type: 'var'; init: Expression | null } - const names = collectIdentifiersFromPattern(declarator.id) - if (names.some((name) => bindings.has(name))) { - for (const name of names) { - bindings.add(name) - } - } - } - } +export interface ExtractedModuleInfo { + bindings: Map + exports: Map + reExportAllSources: Array } -export function removeBindingsTransitivelyDependingOn( - bindings: Set, - dependencyGraph: Map>, - roots: Iterable, -) { - const reverseGraph = new Map>() - - for (const [name, dependencies] of dependencyGraph) { - for (const dependency of dependencies) { - let parents = reverseGraph.get(dependency) - if (!parents) { - parents = new Set() - reverseGraph.set(dependency, parents) - } - parents.add(name) - } +/** The bundler owns cross-module resolution; Yuku provides local module records. */ +export function extractModuleInfo(sourceModule: Module): ExtractedModuleInfo { + const bindings = new Map() + const exportBindings = new Map() + const reExportAllSources: Array = [] + const graph = declarationIndex(sourceModule, sourceModule.rootScope.bindings) + for (const [symbol, declaration] of graph.declarations) { + bindings.set(symbol.name, { + type: 'var', + init: is.VariableDeclarator(declaration) ? declaration.init : null, + }) } - - const visited = new Set() - const queue = [...roots] - - while (queue.length > 0) { - const current = queue.pop()! - if (visited.has(current)) continue - visited.add(current) - - const parents = reverseGraph.get(current) - if (!parents) continue - - for (const parent of parents) { - if (!visited.has(parent)) { - queue.push(parent) - } + for (const record of sourceModule.imports) { + if (record.local && record.specifier && !record.typeOnly) { + bindings.set(record.local.name, { + type: 'import', + source: record.specifier, + importedName: record.isNamespace ? '*' : (record.name ?? 'default'), + }) } } - - for (const name of [...bindings]) { - if (visited.has(name)) { - bindings.delete(name) - } + let syntheticIndex = 0 + const syntheticName = () => { + let name: string + do { + name = `__module_export_${syntheticIndex++}__` + } while (bindings.has(name)) + return name } -} - -export function removeModuleLevelBindings( - ast: t.File, - namesToRemove: Set, -) { - ast.program.body = ast.program.body.filter((statement) => { - const declaration = - t.isExportNamedDeclaration(statement) && statement.declaration - ? statement.declaration - : statement - - if (t.isVariableDeclaration(declaration)) { - declaration.declarations = declaration.declarations.filter( - (declarator) => - !collectIdentifiersFromPattern(declarator.id).some((name) => - namesToRemove.has(name), - ), - ) - return declaration.declarations.length > 0 - } - - if (t.isFunctionDeclaration(declaration) && declaration.id) { - return !namesToRemove.has(declaration.id.name) - } - - if (t.isClassDeclaration(declaration) && declaration.id) { - return !namesToRemove.has(declaration.id.name) - } - - if (t.isExportDefaultDeclaration(statement)) { - const defaultDeclaration = statement.declaration - if ( - (t.isFunctionDeclaration(defaultDeclaration) || - t.isClassDeclaration(defaultDeclaration)) && - defaultDeclaration.id - ) { - return !namesToRemove.has(defaultDeclaration.id.name) - } - } - - return true - }) -} - -export function retainModuleLevelDeclarations( - ast: t.File, - bindingsToKeep: Set, -) { - ast.program.body = ast.program.body.filter((statement) => { - if (t.isImportDeclaration(statement)) return true - - const declaration = - t.isExportNamedDeclaration(statement) && statement.declaration - ? statement.declaration - : statement - - if (t.isVariableDeclaration(declaration)) { - declaration.declarations = declaration.declarations.filter((declarator) => - collectIdentifiersFromPattern(declarator.id).some((name) => - bindingsToKeep.has(name), - ), - ) - return declaration.declarations.length > 0 - } - - if (t.isFunctionDeclaration(declaration) && declaration.id) { - return bindingsToKeep.has(declaration.id.name) - } - - if (t.isClassDeclaration(declaration) && declaration.id) { - return bindingsToKeep.has(declaration.id.name) - } - - return false - }) -} - -export function unwrapExportedDeclarations(ast: t.File) { - const body: Array = [] - - for (const statement of ast.program.body) { - if (t.isExportNamedDeclaration(statement)) { - if (statement.declaration) { - body.push(statement.declaration) - } + for (const record of sourceModule.exports) { + if (record.typeOnly) { continue } - - if (t.isExportDefaultDeclaration(statement)) { - const declaration = statement.declaration - if ( - (t.isFunctionDeclaration(declaration) || - t.isClassDeclaration(declaration)) && - declaration.id - ) { - body.push(declaration) + if (record.kind === 'star' && record.specifier) { + reExportAllSources.push(record.specifier) + } else if (record.name) { + if (record.local) { + exportBindings.set(record.name, record.local.name) + } else if (record.specifier) { + const name = syntheticName() + bindings.set(name, { + type: 'import', + source: record.specifier, + importedName: + record.kind === 'namespace' + ? '*' + : (record.fromName ?? record.name), + }) + exportBindings.set(record.name, name) + } else if (record.name === 'default') { + const statement = sourceModule.ast.body.find( + is.ExportDefaultDeclaration, + ) + if (statement) { + const declaration = statement.declaration + const name = syntheticName() + bindings.set(name, { + type: 'var', + init: is.Expression(declaration) ? declaration : null, + }) + exportBindings.set('default', name) + } } - continue } - - if (t.isExportAllDeclaration(statement)) { - continue - } - - body.push(statement) } - - ast.program.body = body + return { bindings, exports: exportBindings, reExportAllSources } } -export function stripUnreferencedTopLevelExpressionStatements(ast: t.File) { - const locallyBound = new Set() - - for (const statement of ast.program.body) { - collectLocalBindingsFromStatement(statement, locallyBound) - } - - ast.program.body = ast.program.body.filter((statement) => { - if (!t.isExpressionStatement(statement)) return true - - for (const name of collectIdentifiersFromNode(statement)) { - if (locallyBound.has(name)) { - return true - } - } - - return false - }) -} +export { unwrap as unwrapExpression } from 'yuku-ast' diff --git a/packages/router-utils/src/index.ts b/packages/router-utils/src/index.ts index 12c3c8e20c0..e387841ee0d 100644 --- a/packages/router-utils/src/index.ts +++ b/packages/router-utils/src/index.ts @@ -1,34 +1,32 @@ export { - parseAst, - generateFromAst, - deadCodeElimination, - findReferencedIdentifiers, - stripTypeExports, + analyzeModule, + generateModule, + cloneModuleAst, + cloneGeneratedNode, + parseStatements, + parseExpression, + linkGeneratedReference, +} from './ast' +export type { + AnalyzeModuleOptions, + ModuleAstClone, + GenerateResult, } from './ast' -export type { ParseAstOptions, ParseAstResult, GeneratorResult } from './ast' export { logDiff } from './logger' - export { copyFilesPlugin } from './copy-files-plugin' - export { createIdentifier, decodeIdentifier } from './path-ids' - export { - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromNode, - collectIdentifiersFromPattern, - collectLocalBindingsFromStatement, - collectModuleLevelRefsFromNode, - expandDestructuredDeclarations, - expandSharedDestructuredDeclarators, - expandTransitively, - extractModuleInfoFromAst, - getVariableDeclaratorForExpressionPath, - removeBindingsTransitivelyDependingOn, - removeModuleLevelBindings, - retainModuleLevelDeclarations, - stripUnreferencedTopLevelExpressionStatements, + collectModuleReferences, + extractModuleInfo, unwrapExpression, - unwrapExportedDeclarations, + moduleDeclarationGraph, + expandTransitively, + stripTypeExports, + removeUnusedBindings, +} from './compiler-helpers' +export type { + ModuleDeclarationGraph, + RemoveUnusedBindingsOptions, + ExtractedModuleInfo, + ModuleInfoBinding, } from './compiler-helpers' -export type { ExtractedModuleInfo, ModuleInfoBinding } from './compiler-helpers' diff --git a/packages/router-utils/tests/ast.test-d.ts b/packages/router-utils/tests/ast.test-d.ts new file mode 100644 index 00000000000..a38a5deb85d --- /dev/null +++ b/packages/router-utils/tests/ast.test-d.ts @@ -0,0 +1,25 @@ +import { expectTypeOf, test } from 'vitest' +import { b } from 'yuku-ast' +import { + analyzeModule, + cloneGeneratedNode, + cloneModuleAst, + generateModule, + linkGeneratedReference, +} from '../src/ast' +import type { Identifier, Program } from '@yuku-toolchain/types' +import type { Module } from 'yuku-analyzer' + +test('native AST and semantic handles preserve their types', () => { + const module = analyzeModule({ code: 'const value = 1' }) + expectTypeOf(module).toEqualTypeOf() + const clone = cloneModuleAst(module) + expectTypeOf(clone.program).toEqualTypeOf() + const reference = linkGeneratedReference( + b.Identifier({ name: 'value' }), + 'value', + ) + expectTypeOf(reference).toEqualTypeOf() + expectTypeOf(cloneGeneratedNode(reference)).toEqualTypeOf() + expectTypeOf(generateModule(clone.program).code).toEqualTypeOf() +}) diff --git a/packages/router-utils/tests/compiler-helpers.test.ts b/packages/router-utils/tests/compiler-helpers.test.ts index 00b75d67e51..44fcbf46787 100644 --- a/packages/router-utils/tests/compiler-helpers.test.ts +++ b/packages/router-utils/tests/compiler-helpers.test.ts @@ -1,249 +1,389 @@ -import * as t from '@babel/types' +import { runInNewContext } from 'node:vm' import { describe, expect, test } from 'vitest' +import { is, walk } from 'yuku-ast' import { - buildDeclarationMap, - collectIdentifiersFromNode, - collectLocalBindingsFromStatement, - extractModuleInfoFromAst, + analyzeModule, + cloneGeneratedNode, + cloneModuleAst, + generateModule, + parseStatements, +} from '../src/ast' +import { + collectModuleReferences, + extractModuleInfo, + moduleDeclarationGraph, + removeUnusedBindings, } from '../src/compiler-helpers' -import { parseAst } from '../src/ast' - -function getVariableInit(code: string) { - const ast = parseAst({ code, filename: 'test.tsx' }) - const declaration = ast.program.body.find((node) => - t.isVariableDeclaration(node), - ) as t.VariableDeclaration - return declaration.declarations[0]!.init! -} -function collectSortedIdentifiers(node: t.Node) { - return [...collectIdentifiersFromNode(node)].sort() +function cleanup(code: string, erase: string) { + const module = analyzeModule({ code }) + const { program, originalNodes } = cloneModuleAst(module) + walk(program, { + Property(node, context) { + if (is.Identifier(node.key, erase)) { + context.remove() + } + }, + }) + removeUnusedBindings(module, program, originalNodes) + return generateModule(program).code } -function collectSortedStatementBindings(code: string) { - const ast = parseAst({ code, filename: 'test.tsx' }) - const bindings = new Set() - for (const statement of ast.program.body) { - collectLocalBindingsFromStatement(statement, bindings) - } - return [...bindings].sort() -} +describe('semantic dependency analysis', () => { + test('resolves nested closures, defaults, imports, and JSX without false shadowed dependencies', () => { + const module = analyzeModule({ + code: ` + import { Component, dep, fallback } from 'pkg' + const value = (param = fallback) => { + const dep = param + try { throw dep } catch (Component) { console.log(Component) } + return () => + } + `, + }) + const graph = moduleDeclarationGraph(module) + const value = module.rootScope.find('value')! + expect( + [...graph.dependencies.get(value)!].map((symbol) => symbol.name).sort(), + ).toEqual(['Component', 'fallback']) + expect( + [...collectModuleReferences(module, graph.declarations.get(value)!)] + .map((symbol) => symbol.name) + .sort(), + ).toEqual(['Component', 'fallback']) + }) -function collectSortedDeclarationMapEntries(code: string) { - const ast = parseAst({ code, filename: 'test.tsx' }) - return [...buildDeclarationMap(ast)] - .map(([name, node]): [string, string] => [name, node.type]) - .sort((left, right) => (left[0] < right[0] ? -1 : 1)) -} + test('maps named default function and class declarations', () => { + for (const code of [ + 'export default function named() {}', + 'export default class named {}', + ]) { + const module = analyzeModule({ code }) + expect( + moduleDeclarationGraph(module).declarations.get( + module.rootScope.find('named')!, + )?.type, + ).toMatch(/Declaration$/) + } + }) -function collectModuleInfoSnapshot(code: string) { - const ast = parseAst({ code, filename: 'test.tsx' }) - const info = extractModuleInfoFromAst(ast) - return { - bindings: [...info.bindings] - .map(([name, binding]) => [ - name, - binding.type === 'import' - ? `${binding.source}:${binding.importedName}` - : (binding.init?.type ?? null), - ]) - .sort((left, right) => (left[0]! < right[0]! ? -1 : 1)), - exports: [...info.exports].sort((left, right) => - left[0] < right[0] ? -1 : 1, - ), - reExportAllSources: info.reExportAllSources, - } -} + test('extracts module imports, exports, and re-export sources through native records', () => { + const module = analyzeModule({ + code: ` + import value, { dep as local } from 'dependency' + export const result = value(local) + export { result as renamed } + export { another } from './other' + export * from './all' + `, + }) + expect( + module.imports.map((record) => [ + record.local?.name, + record.specifier, + record.name, + ]), + ).toEqual([ + ['value', 'dependency', 'default'], + ['local', 'dependency', 'dep'], + ]) + expect( + module.exports.map((record) => [record.name, record.specifier]), + ).toEqual([ + ['result', null], + ['renamed', null], + ['another', './other'], + [null, './all'], + ]) + }) -describe('collectIdentifiersFromNode', () => { - test('collects free identifiers without reporting nested local bindings', () => { - const init = getVariableInit(` -const value = outer + (() => { - const local = dep - - function nested(param = fallback) { - const Inner = () => - const LocalExpr = class NamedLocal { - method() { - return NamedLocal + local + param - } - } + test('keeps distinct re-export identities when imported names collide', () => { + const module = analyzeModule({ + code: ` + const foo = localFactory() + export { foo } + export { foo as a } from './a' + export { foo as b } from './b' + `, + }) + const info = extractModuleInfo(module) + expect(info.bindings.get(info.exports.get('foo')!)?.type).toBe('var') + expect(info.bindings.get(info.exports.get('a')!)).toEqual({ + type: 'import', + source: './a', + importedName: 'foo', + }) + expect(info.bindings.get(info.exports.get('b')!)).toEqual({ + type: 'import', + source: './b', + importedName: 'foo', + }) + }) - class LocalComponent {} + test('includes overloaded implementations and merged namespace dependencies', () => { + const module = analyzeModule({ + code: ` + const dep = 1 + const another = 2 + function helper(value: string): string + function helper(value: number): number + function helper(value: any) { return dep + value } + namespace Merged { export const a = dep } + namespace Merged { export const b = another } + export const result = helper(Merged.a + Merged.b) + `, + }) + const graph = moduleDeclarationGraph(module) + const helper = module.rootScope.find('helper')! + const merged = module.rootScope.find('Merged')! + expect(graph.declarations.get(helper)?.type).toBe('FunctionDeclaration') + expect( + [...graph.dependencies.get(helper)!].map((symbol) => symbol.name), + ).toEqual(['dep']) + expect( + [...graph.dependencies.get(merged)!].map((symbol) => symbol.name).sort(), + ).toEqual(['another', 'dep']) + expect( + [...graph.declarationSymbols.values()].filter((owners) => + owners.has(helper), + ), + ).toHaveLength(3) + expect( + [...graph.declarationSymbols.values()].filter((owners) => + owners.has(merged), + ), + ).toHaveLength(2) + const { program, originalNodes } = cloneModuleAst(module) + removeUnusedBindings(module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + const output = generateModule(program).code + expect(output).toContain('return dep + value') + expect(output).toContain('const b = another') + expect(output).toContain('const dep = 1') + expect(output).toContain('const another = 2') + }) - return local + param + imported + Inner + LocalExpr - } + test('tracks runtime enum and namespace declarations as owned bindings', () => { + const module = analyzeModule({ + code: 'enum E { A }; namespace N { export const x = E.A } export const value = N.x;', + }) + const graph = moduleDeclarationGraph(module) + expect(graph.declarations.get(module.rootScope.find('E')!)?.type).toBe( + 'TSEnumDeclaration', + ) + expect(graph.declarations.get(module.rootScope.find('N')!)?.type).toBe( + 'TSModuleDeclaration', + ) + expect( + [...graph.dependencies.get(module.rootScope.find('N')!)!].map( + (symbol) => symbol.name, + ), + ).toEqual(['E']) + }) - return nested() -})() -`) + test('groups destructured symbols in one initialization unit', () => { + const module = analyzeModule({ + code: 'const { a, nested: { b } } = initialize()', + }) + const graph = moduleDeclarationGraph(module) + expect(graph.declarations.get(module.rootScope.find('a')!)).toBe( + graph.declarations.get(module.rootScope.find('b')!), + ) + }) +}) - expect(collectSortedIdentifiers(init)).toMatchInlineSnapshot(` - [ - "dep", - "fallback", - "imported", - "outer", - ] - `) +describe('output liveness', () => { + test('removes transitively erased server dependencies while preserving unrelated side effects', () => { + const output = cleanup( + ` + import { server } from './server' + import './side-effect' + const load = () => server() + const unused = initialize() + export const Route = createRoute({ loader: load, component: () => 'ok' }) + `, + 'loader', + ) + expect(output).not.toContain('./server') + expect(output).not.toContain('const load') + expect(output).toContain("import './side-effect'") + expect(output).toContain('initialize()') }) - test('respects nested variable, parameter, catch, and import shadowing', () => { - const ast = parseAst({ - code: ` -import { external as localImport } from 'pkg' + test('retains destructuring as a whole when one binding is needed', () => { + const output = cleanup( + `const { a, b } = initialize(); export const Route = createRoute({ loader: () => a, component: () => b })`, + 'loader', + ) + expect(output).toContain('a, b') + expect(output.match(/initialize\(\)/g)).toHaveLength(1) + }) -const value = (localParam = defaultValue) => { - const localShadow = factory(localImport) + test.each([true, false])( + 'executes whole destructured initializers only when a sibling is live: %s', + (used) => { + const module = analyzeModule({ + code: `const { first, middle, last } = initialize(); ${used ? 'globalThis.result = last' : ''}`, + }) + const { program, originalNodes } = cloneModuleAst(module) + removeUnusedBindings(module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + const events: Array = [] + const context = { + result: undefined, + initialize() { + events.push('initialize') + return { + get first() { + events.push('first') + return 0 + }, + get middle() { + events.push('middle') + return 1 + }, + get last() { + events.push('last') + return 2 + }, + } + }, + } + runInNewContext(generateModule(program).code, context) + expect(context.result).toBe(used ? 2 : undefined) + expect(events).toEqual( + used ? ['initialize', 'first', 'middle', 'last'] : [], + ) + }, + ) - try { - throw thrown - } catch (thrown) { - const factory = () => localShadow + localParam + thrown - return factory() - } -} -`, - filename: 'test.ts', + test('removes unreachable cycles after their last consumer is erased', () => { + const output = cleanup( + 'const a = () => b(); const b = () => a(); export const Route = createRoute({ loader: a })', + 'loader', + ) + expect(output).not.toContain('const a') + expect(output).not.toContain('const b') + }) + + test('does not change original AST or symbol identities when generating multiple outputs', () => { + const module = analyzeModule({ + code: 'const value = 1; export const Route = value;', }) + const original = generateModule(module.ast).code + const first = cloneModuleAst(module) + first.program.body.splice(0, 1) + const second = cloneModuleAst(module) + expect(generateModule(second.program).code).toBe(original) + expect(module.rootScope.find('value')!.references).toHaveLength(1) + }) - expect(collectSortedIdentifiers(ast.program)).toMatchInlineSnapshot(` - [ - "defaultValue", - "factory", - "thrown", - ] - `) + test('retains exported namespace members through the live namespace owner', () => { + const module = analyzeModule({ + code: `namespace Labels { export const component = 'count' } export { Labels }`, + }) + const { program, originalNodes } = cloneModuleAst(module) + removeUnusedBindings(module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + expect(generateModule(program).code).toContain( + "export const component = 'count'", + ) }) -}) -describe('collectLocalBindingsFromStatement', () => { - test('collects ids from named default function and class declarations', () => { - expect({ - class: collectSortedStatementBindings( - `export default class DefaultComponent {}`, - ), - function: collectSortedStatementBindings( - `export default function DefaultRoute() {}`, - ), - anonymous: collectSortedStatementBindings( - `export default function () {}`, - ), - }).toMatchInlineSnapshot(` - { - "anonymous": [], - "class": [ - "DefaultComponent", - ], - "function": [ - "DefaultRoute", - ], - } - `) + test('does not retain a runtime import used only in erased type positions', () => { + const module = analyzeModule({ + code: `import { Framework } from './server-only'; export const value = (): Framework => null as Framework`, + }) + const { program, originalNodes } = cloneModuleAst(module) + removeUnusedBindings(module, program, originalNodes) + expect(generateModule(program).code).not.toContain('./server-only') }) -}) -describe('buildDeclarationMap', () => { - test('maps named default function and class declarations', () => { - expect({ - class: collectSortedDeclarationMapEntries( - `export default class DefaultComponent {}`, - ), - function: collectSortedDeclarationMapEntries( - `export default function DefaultRoute() {}`, - ), - anonymous: collectSortedDeclarationMapEntries(`export default class {}`), - }).toMatchInlineSnapshot(` - { - "anonymous": [], - "class": [ - [ - "DefaultComponent", - "ClassDeclaration", - ], - ], - "function": [ - [ - "DefaultRoute", - "FunctionDeclaration", - ], - ], + test('removes a dead namespace including its exported members', () => { + const output = cleanup( + `namespace Labels { export const component = initialize() } export const Route = createRoute({ loader: () => Labels.component })`, + 'loader', + ) + expect(output).not.toContain('namespace Labels') + expect(output).not.toContain('initialize()') + }) + + test('removes nested erased captures without keeping their enclosing dead closure', () => { + const output = cleanup( + ` + import { server } from './server' + function factory() { + const initiallyUnused = sideEffect() + return server() } - `) + export const Route = createRoute({ loader: factory }) + `, + 'loader', + ) + expect(output).not.toContain('./server') + expect(output).not.toContain('factory') + expect(output).not.toContain('initiallyUnused') }) -}) -describe('extractModuleInfoFromAst', () => { - test('extracts imports, local exports, default exports, and re-export sources', () => { - expect( - collectModuleInfoSnapshot(` - import defaultImport, { named as localNamed } from 'pkg' - import * as ns from 'pkg-ns' - const local = localNamed - export const exported = local - export function loader() {} - export default class DefaultRoute {} - export { remote as renamed } from './remote' - export * from './all' - `), - ).toMatchInlineSnapshot(` - { - "bindings": [ - [ - "DefaultRoute", - null, - ], - [ - "defaultImport", - "pkg:default", - ], - [ - "exported", - "Identifier", - ], - [ - "loader", - null, - ], - [ - "local", - "Identifier", - ], - [ - "localNamed", - "pkg:named", - ], - [ - "ns", - "pkg-ns:*", - ], - [ - "remote", - "./remote:remote", - ], - ], - "exports": [ - [ - "default", - "DefaultRoute", - ], - [ - "exported", - "exported", - ], - [ - "loader", - "loader", - ], - [ - "renamed", - "remote", - ], - ], - "reExportAllSources": [ - "./all", - ], + test('removes dependencies scoped inside surviving functions', () => { + const output = cleanup( + ` + import { server } from './server' + export function factory() { + const load = () => server() + const initiallyUnused = sideEffect() + return createRoute({ loader: load, component: () => 'ok' }) } - `) + `, + 'loader', + ) + expect(output).not.toContain('./server') + expect(output).not.toContain('const load') + expect(output).toContain('initiallyUnused') + }) + + test('generated parameter shadowing cannot retain an erased server import', () => { + const module = analyzeModule({ + code: `import { server } from './server'; export const result = server()`, + }) + const { program, originalNodes } = cloneModuleAst(module) + program.body.splice( + 1, + 1, + ...parseStatements('export const result = (server) => server()'), + ) + removeUnusedBindings(module, program, originalNodes) + expect(generateModule(program).code).not.toContain('./server') + }) + + test('retains source dependencies introduced in generated nodes', () => { + const module = analyzeModule({ code: 'const value = 1;' }) + const { program, originalNodes } = cloneModuleAst(module) + program.body.push(...parseStatements('export const result = value')) + removeUnusedBindings(module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + expect(generateModule(program).code).toContain('const value = 1') + }) + + test('retains nested source references when cloning a generated fragment', async () => { + const module = analyzeModule({ code: 'const value = 41;' }) + const { program, originalNodes } = cloneModuleAst(module) + const generated = parseStatements( + 'export const result = (() => ({ read: () => value + 1 }))().read()', + )[0]! + program.body.push(cloneGeneratedNode(generated)) + removeUnusedBindings(module, program, originalNodes, { + preserveInitiallyUnused: false, + }) + const output = generateModule(program).code + expect(output).toContain('const value = 41') + const evaluated = await import( + `data:text/javascript;base64,${Buffer.from(output).toString('base64')}` + ) + expect(evaluated.result).toBe(42) }) }) diff --git a/packages/router-utils/tests/stripTypeExports.test.ts b/packages/router-utils/tests/stripTypeExports.test.ts index 32d25f1cbe9..21e03e248c9 100644 --- a/packages/router-utils/tests/stripTypeExports.test.ts +++ b/packages/router-utils/tests/stripTypeExports.test.ts @@ -1,13 +1,11 @@ import { describe, expect, test } from 'vitest' -import { generateFromAst, parseAst, stripTypeExports } from '../src/ast' +import { generateModule, analyzeModule } from '../src/ast' +import { stripTypeExports } from '../src/compiler-helpers' function transform(code: string): string { - const ast = parseAst({ code }) - stripTypeExports(ast) - return generateFromAst(ast, { - sourceFileName: 'test.ts', - filename: 'test.ts', - }).code + const ast = analyzeModule({ code }) + stripTypeExports(ast.ast) + return generateModule(ast.ast, { source: code, filename: 'test.ts' }).code } describe('stripTypeExports', () => { @@ -16,14 +14,14 @@ describe('stripTypeExports', () => { const code = `import data from './data.json' with { type: 'json' } export const value = data` - expect(() => parseAst({ code })).not.toThrow() + expect(() => analyzeModule({ code })).not.toThrow() }) test('parses import attributes with deprecated assert syntax', () => { const code = `import data from './data.json' assert { type: 'json' } export const value = data` - expect(() => parseAst({ code })).not.toThrow() + expect(() => analyzeModule({ code })).not.toThrow() }) test('parses angle-bracket type assertions in .ts files without JSX', () => { @@ -31,7 +29,7 @@ export const value = data` return value }` - expect(() => parseAst({ code, filename: 'cast.ts' })).not.toThrow() + expect(() => analyzeModule({ code, filename: 'cast.ts' })).not.toThrow() }) }) diff --git a/packages/start-plugin-core/package.json b/packages/start-plugin-core/package.json index b837c5edcc7..c0856455e76 100644 --- a/packages/start-plugin-core/package.json +++ b/packages/start-plugin-core/package.json @@ -85,9 +85,6 @@ "node": ">=22.12.0" }, "dependencies": { - "@babel/code-frame": "7.29.7", - "@babel/core": "catalog:", - "@babel/types": "catalog:", "@jridgewell/remapping": "^2.3.5", "@tanstack/router-core": "workspace:*", "@tanstack/router-generator": "workspace:*", @@ -105,12 +102,13 @@ "ufo": "^1.6.4", "vitefu": "^1.1.3", "xmlbuilder2": "^4.0.3", - "zod": "catalog:" + "zod": "catalog:", + "@yuku-toolchain/types": "0.11.0", + "yuku-analyzer": "0.11.0", + "yuku-ast": "0.11.0" }, "devDependencies": { "@rsbuild/core": "catalog:", - "@types/babel__code-frame": "^7.0.6", - "@types/babel__core": "^7.20.5", "@types/node": ">=20", "@types/picomatch": "^4.0.2", "vite": "*", diff --git a/packages/start-plugin-core/src/hydrate-when-transform.ts b/packages/start-plugin-core/src/hydrate-when-transform.ts index d88ddb60d06..a1039c305c1 100644 --- a/packages/start-plugin-core/src/hydrate-when-transform.ts +++ b/packages/start-plugin-core/src/hydrate-when-transform.ts @@ -1,25 +1,22 @@ import { relative } from 'node:path' import crypto from 'node:crypto' -import babel from '@babel/core' -import * as t from '@babel/types' +import { b, is, nameOf, walk } from 'yuku-ast' import { - buildDeclarationMap, - buildDependencyGraph, - collectIdentifiersFromNode, - collectIdentifiersFromPattern, - collectLocalBindingsFromStatement, - deadCodeElimination, + analyzeModule, + cloneModuleAst, + collectModuleReferences, expandTransitively, - findReferencedIdentifiers, - generateFromAst, - parseAst, - removeModuleLevelBindings, - retainModuleLevelDeclarations, - stripUnreferencedTopLevelExpressionStatements, - unwrapExportedDeclarations, + generateModule, + moduleDeclarationGraph, + parseExpression, + parseStatements, + removeUnusedBindings, + unwrapExpression, } from '@tanstack/router-utils' import { tssHydrate } from './hydration-constants' import { cleanId, codeFrameError } from './start-compiler/utils' +import type { Module, Symbol } from 'yuku-analyzer' +import type * as t from '@yuku-toolchain/types' import type { CompileStartFrameworkOptions, StartCompilerPlugin, @@ -53,34 +50,6 @@ function createBoundaryId(root: string, sourceId: string) { } } -function getJSXElementName(node: t.JSXElement) { - const name = node.openingElement.name - return t.isJSXIdentifier(name) ? name.name : undefined -} - -function getJSXAttribute(node: t.JSXOpeningElement, name: string) { - for (const item of node.attributes) { - if (t.isJSXAttribute(item) && t.isJSXIdentifier(item.name, { name })) { - return item - } - } - - return undefined -} - -function getBooleanProp(node: t.JSXOpeningElement, name: string) { - const attr = getJSXAttribute(node, name) - if (!attr) return undefined - if (!attr.value) return true - if (t.isStringLiteral(attr.value)) return attr.value.value !== 'false' - if (t.isJSXExpressionContainer(attr.value)) { - if (t.isBooleanLiteral(attr.value.expression)) { - return attr.value.expression.value - } - } - return undefined -} - function parseHydrateVirtualId(id: string) { const queryIndex = id.indexOf('?') const sourceId = cleanId(queryIndex === -1 ? id : id.slice(0, queryIndex)) @@ -109,783 +78,562 @@ function parseHydrateVirtualId(id: string) { } } -function isObjectPropertyName( - property: t.ObjectMethod | t.ObjectProperty, - name: string, -) { - if (t.isIdentifier(property.key) && !property.computed) { - return property.key.name === name - } - - return t.isStringLiteral(property.key) && property.key.value === name +interface HydrateAst { + ast: t.Program + module: Module + originalNodes: WeakMap } -function isReferenceInsideAnyNode( - referencePath: babel.NodePath, - nodes: ReadonlySet, -) { - if (nodes.has(referencePath.node)) return true - return Boolean(referencePath.findParent((parent) => nodes.has(parent.node))) +function getJSXElementName(node: t.JSXElement) { + return is.JSXIdentifier(node.openingElement.name) + ? node.openingElement.name.name + : undefined } -function stripBindingsOnlyReferencedBy( - path: babel.NodePath, - node: t.Node, - seen = new Set(), - preserve = new Set(), -) { - stripBindingsOnlyReferencedByNodes(path.scope, [node], seen, preserve) +function getJSXAttribute(node: t.JSXOpeningElement, name: string) { + return node.attributes.find( + (attribute): attribute is t.JSXAttribute => + is.JSXAttribute(attribute) && + is.JSXIdentifier(attribute.name) && + attribute.name.name === name, + ) } -function stripBindingsOnlyReferencedByNodes( - scope: babel.NodePath['scope'], - nodes: ReadonlyArray, - seen = new Set(), - preserve = new Set(), -) { - const nodeSet = new Set(nodes) - const names = new Set() - nodes.forEach((node) => { - collectIdentifiersFromNode(node).forEach((name) => names.add(name)) - }) - - for (const name of names) { - if (seen.has(name)) continue - if (preserve.has(name)) continue - const binding = scope.getBinding(name) - if (!binding?.constant) continue - if ( - binding.path.findParent( - (parentPath) => - parentPath.isExportNamedDeclaration() || - parentPath.isExportDefaultDeclaration(), - ) - ) { - continue - } - if (binding.referencePaths.length === 0) continue - if ( - !binding.referencePaths.every((referencePath) => - isReferenceInsideAnyNode(referencePath, nodeSet), - ) - ) { - continue - } - - seen.add(name) - - const declarationPath = binding.path.isVariableDeclarator() - ? binding.path - : binding.path.findParent((parentPath) => - parentPath.isVariableDeclarator(), - ) - const patternHasExternalReferences = - declarationPath?.isVariableDeclarator() && - !t.isIdentifier(declarationPath.node.id) && - collectIdentifiersFromPattern(declarationPath.node.id).some( - (bindingName) => { - if (bindingName === binding.identifier.name) return false - - const siblingBinding = binding.scope.getBinding(bindingName) - return siblingBinding?.referencePaths.some( - (referencePath) => - !isReferenceInsideAnyNode(referencePath, nodeSet), - ) - }, - ) - - if (patternHasExternalReferences) { - continue - } - - const bindingNode = binding.path.node - if (t.isVariableDeclarator(bindingNode) && bindingNode.init) { - stripBindingsOnlyReferencedByNodes( - binding.scope, - [bindingNode.init], - seen, - preserve, - ) - } else if ( - t.isFunctionDeclaration(bindingNode) || - t.isClassDeclaration(bindingNode) - ) { - stripBindingsOnlyReferencedByNodes( - binding.scope, - [bindingNode], - seen, - preserve, - ) - } - - if (binding.path.isVariableDeclarator()) { - const declarationPath = binding.path.parentPath - if ( - declarationPath.isVariableDeclaration() && - declarationPath.node.declarations.length === 1 - ) { - declarationPath.remove() - continue - } - - binding.path.remove() - continue - } - - if ( - binding.path.isImportSpecifier() || - binding.path.isImportDefaultSpecifier() || - binding.path.isImportNamespaceSpecifier() - ) { - const importPath = binding.path.parentPath - if ( - importPath.isImportDeclaration() && - importPath.node.specifiers.length === 1 - ) { - importPath.remove() - continue - } - - binding.path.remove() - continue +function getBooleanProp(node: t.JSXOpeningElement, name: string) { + const attribute = getJSXAttribute(node, name) + if (!attribute) { + return undefined + } + if (!attribute.value) { + return true + } + if (is.StringLiteral(attribute.value)) { + return attribute.value.value !== 'false' + } + if (is.JSXExpressionContainer(attribute.value)) { + const expression = is.Expression(attribute.value.expression) + ? unwrapExpression(attribute.value.expression) + : attribute.value.expression + if (is.BooleanLiteral(expression)) { + return expression.value } - - binding.path.remove() } + return undefined } -function getSingleUseObjectExpressionBinding( - path: babel.NodePath, - identifier: t.Identifier, -) { - const binding = path.scope.getBinding(identifier.name) - if (!binding?.constant) return undefined - if (binding.referencePaths.length !== 1) return undefined - if (binding.referencePaths[0]?.node !== identifier) return undefined - if (!binding.path.isVariableDeclarator()) return undefined - const init = binding.path.node.init - return t.isObjectExpression(init) ? init : undefined +function propertyIs(property: t.Property, name: string) { + return ( + (!property.computed || is.StringLiteral(property.key)) && + nameOf(property.key) === name + ) } function objectExpressionMayHaveProperty( node: t.ObjectExpression, name: string, ) { - return node.properties.some((property) => { - if (t.isSpreadElement(property)) return true - if (!t.isObjectMethod(property) && !t.isObjectProperty(property)) { - return true - } - if (property.computed) return true - return isObjectPropertyName(property, name) - }) + return node.properties.some( + (property) => + is.SpreadElement(property) || + property.computed || + propertyIs(property, name), + ) } -function stripObjectExpressionProperty( - path: babel.NodePath, - node: t.ObjectExpression, - name: string, -) { - let modified = false - - node.properties = node.properties.filter((property) => { - if ( - (t.isObjectMethod(property) || t.isObjectProperty(property)) && - isObjectPropertyName(property, name) - ) { - stripBindingsOnlyReferencedBy( - path, - t.isObjectProperty(property) ? property.value : property.body, - ) - modified = true - return false - } - - return true - }) +function stripObjectExpressionProperty(node: t.ObjectExpression, name: string) { + const before = node.properties.length + node.properties = node.properties.filter( + (property) => !is.Property(property) || !propertyIs(property, name), + ) + return before !== node.properties.length +} - return modified +function sourceNode(context: HydrateAst, node: t.Node) { + return context.originalNodes.get(node) ?? node } -function throwBoundaryError( - code: string, - path: babel.NodePath, - message: string, -): never { - if (path.node.loc) { - throw codeFrameError(code, path.node.loc, message) +function getSingleUseObjectExpressionBinding( + context: HydrateAst, + identifier: t.Identifier, + objectExpressions: WeakMap, +) { + const original = sourceNode(context, identifier) + const symbol = context.module.symbolOf(original) + if ( + !symbol || + symbol.references.length !== 1 || + symbol.references[0]?.node !== original || + symbol.references.some((reference) => reference.isWrite) + ) { + return undefined } - throw new Error(message) + const declarationIdentifier = symbol.declarations[0] + const declaration = + declarationIdentifier && context.module.parentOf(declarationIdentifier) + if (!is.VariableDeclarator(declaration) || !declaration.init) { + return undefined + } + const init = unwrapExpression(declaration.init) + if (!is.ObjectExpression(init)) { + return undefined + } + return objectExpressions.get(init) } -function inspectSplitBoundary(options: { - code: string - path: babel.NodePath - validate?: boolean - collectCaptured?: boolean - nestedHydrate?: { - localName: string +function isWithin(module: Module, node: t.Node, parent: t.Node) { + let current: t.Node | null = node + while (current) { + if (current === parent) { + return true + } + current = module.parentOf(current) } -}) { - const { path } = options - const capturedNames = options.collectCaptured ? new Set() : undefined - const nestedHydrate = options.nestedHydrate - let nestedBoundaryCount = 0 + return false +} +function inspectSplitBoundary( + context: HydrateAst, + node: t.JSXElement, + options: { + code: string + validate?: boolean + collectCaptured?: boolean + nestedHydrate?: { localName: string } + }, +) { + const captured = new Set() + let nestedBoundaryCount = 0 + const fail = (message: string): never => { + throw codeFrameError(options.code, sourceNode(context, node), message) + } if (options.validate) { - for (const child of path.node.children) { + for (const child of node.children) { + const expression = + is.JSXExpressionContainer(child) && is.Expression(child.expression) + ? unwrapExpression(child.expression) + : undefined if ( - t.isJSXExpressionContainer(child) && - (t.isFunctionExpression(child.expression) || - t.isArrowFunctionExpression(child.expression)) + is.FunctionExpression(expression) || + is.ArrowFunctionExpression(expression) ) { - throwBoundaryError( - options.code, - path, + fail( 'Hydrate cannot code-split function-as-children. Use split={false} for this boundary.', ) } } } - - const rootVisitors = { - JSXOpeningElement(openingPath: babel.NodePath) { - if (openingPath.node === path.node.openingElement) { - openingPath.skip() + const originalBoundary = sourceNode(context, node) + walk(node, { + enter(current) { + if (!options.collectCaptured) { + return + } + const reference = context.module.referenceOf(sourceNode(context, current)) + const symbol = reference?.symbol + if ( + !reference || + reference.inTypePosition || + !symbol || + symbol.scope === context.module.rootScope + ) { + return } + if ( + symbol.declarations.some((declaration) => + isWithin(context.module, declaration, originalBoundary), + ) + ) { + return + } + captured.add(symbol.name) }, - JSXClosingElement(closingPath: babel.NodePath) { - closingPath.skip() + JSXOpeningElement(current, visitor) { + if (current === node.openingElement) { + visitor.skip() + } }, - } - - const validateVisitors = options.validate - ? { - CallExpression(callPath: babel.NodePath) { - if (!t.isIdentifier(callPath.node.callee)) return - if (!/^use[A-Z0-9]/.test(callPath.node.callee.name)) return - - throwBoundaryError( - options.code, - path, - 'Hydrate cannot code-split JSX that calls hooks during render. Move the hook call into a child component or use split={false}.', - ) - }, - ThisExpression(thisPath: babel.NodePath) { - void thisPath - throwBoundaryError( - options.code, - path, - 'Hydrate cannot code-split JSX that captures this.', - ) - }, - Super(superPath: babel.NodePath) { - void superPath - throwBoundaryError( - options.code, - path, - 'Hydrate cannot code-split JSX that captures super.', - ) - }, + JSXClosingElement(_current, visitor) { + visitor.skip() + }, + JSXElement(current) { + if ( + current !== node && + options.nestedHydrate && + getJSXElementName(current) === options.nestedHydrate.localName && + getBooleanProp(current.openingElement, 'split') !== false + ) { + nestedBoundaryCount++ } - : {} - - const nestedHydrateVisitors = nestedHydrate - ? { - JSXElement(nestedPath: babel.NodePath) { - if (getJSXElementName(nestedPath.node) !== nestedHydrate.localName) { - return - } - - const split = getBooleanProp(nestedPath.node.openingElement, 'split') - if (split === false) return - - nestedBoundaryCount++ - }, + }, + CallExpression(current) { + const callee = unwrapExpression(current.callee) + if ( + options.validate && + is.Identifier(callee) && + /^use[A-Z0-9]/.test(callee.name) + ) { + fail( + 'Hydrate cannot code-split JSX that calls hooks during render. Move the hook call into a child component or use split={false}.', + ) } - : {} - - const captureVisitors = capturedNames - ? { - Identifier(identifierPath: babel.NodePath) { - const parent = identifierPath.parent - if ( - t.isJSXOpeningElement(parent) || - t.isJSXClosingElement(parent) || - (t.isObjectProperty(parent, { key: identifierPath.node }) && - !parent.computed && - !parent.shorthand) || - (t.isMemberExpression(parent, { - property: identifierPath.node, - }) && - !parent.computed) - ) { - return - } - - const binding = identifierPath.scope.getBinding( - identifierPath.node.name, - ) - if (!binding) return - if (t.isProgram(binding.scope.block)) return - if ( - path.node === binding.scope.block || - path.isAncestor(binding.path) - ) - return - - capturedNames.add(identifierPath.node.name) - }, - JSXIdentifier(identifierPath: babel.NodePath) { - if (identifierPath.parentKey !== 'name') return - const name = identifierPath.node.name - if (!/^[A-Z]/.test(name)) return - const binding = identifierPath.scope.getBinding(name) - if (!binding) return - if (t.isProgram(binding.scope.block)) return - - capturedNames.add(name) - }, + }, + ThisExpression() { + if (options.validate) { + fail('Hydrate cannot code-split JSX that captures this.') } - : {} - - path.traverse({ - ...rootVisitors, - ...validateVisitors, - ...nestedHydrateVisitors, - ...captureVisitors, + }, + Super() { + if (options.validate) { + fail('Hydrate cannot code-split JSX that captures super.') + } + }, }) - - return { - captured: capturedNames ? [...capturedNames].sort() : [], - nestedBoundaryCount, - } + return { captured: [...captured].sort(), nestedBoundaryCount } } function getHydrateImport( - ast: t.File, + ast: t.Program, framework: CompileStartFrameworkOptions, ) { - const hydrateImportSource = `@tanstack/${framework}-start` - - for (const node of ast.program.body) { - if (!t.isImportDeclaration(node)) continue - if (node.source.value !== hydrateImportSource) continue - - for (const specifier of node.specifiers) { + for (const statement of ast.body) { + if ( + !is.ImportDeclaration(statement) || + statement.source.value !== `@tanstack/${framework}-start` + ) { + continue + } + for (const specifier of statement.specifiers) { if ( - t.isImportSpecifier(specifier) && - t.isIdentifier(specifier.imported, { name: 'Hydrate' }) + is.ImportSpecifier(specifier) && + nameOf(specifier.imported) === 'Hydrate' ) { - return { - hydrateLocalName: specifier.local.name, - } + return { hydrateLocalName: specifier.local.name } } } } - return undefined } -function getMeaningfulChildren( - children: Array, -) { +function getMeaningfulChildren(children: t.JSXElement['children']) { return children.filter( - (child) => !(t.isJSXText(child) && child.value.trim() === ''), + (child) => !is.JSXText(child) || child.value.trim() !== '', ) } -function transformHydrateAst(options: { - ast: t.File - code: string - id: string - root: string - env: 'client' | 'server' - framework: CompileStartFrameworkOptions - indexOffset?: number -}) { - if (!options.code.includes('Hydrate')) return null - +function transformHydrateAst( + options: HydrateAst & { + code: string + id: string + root: string + env: 'client' | 'server' + framework: CompileStartFrameworkOptions + indexOffset?: number + }, +) { + if (!options.code.includes('Hydrate')) { + return null + } const hydrateImport = getHydrateImport(options.ast, options.framework) - if (!hydrateImport) return null - const { hydrateLocalName: localName } = hydrateImport + if (!hydrateImport) { + return null + } + const localName = hydrateImport.hydrateLocalName const sourceId = cleanId(options.id) const getBoundaryId = createBoundaryId(options.root, sourceId) - let nextBoundaryIndex = options.indexOffset ?? 0 - const state = { - modified: false, - extractedChildNodes: [] as Array, - capturedNames: new Set(), + const transformation = { modified: false } + let lazyName: string | undefined + const names = new Set([ + ...options.module.symbols.map((symbol) => symbol.name), + ...options.module.unresolvedReferences.map((reference) => reference.name), + ]) + const fresh = (base: string) => { + let name = `_${base}` + let count = 2 + while (names.has(name)) { + name = `_${base}${count++}` + } + names.add(name) + return name } - let lazyIdent: t.Identifier | undefined - - babel.traverse(options.ast, { - Program(programPath) { - programPath.traverse({ - JSXElement(path) { - if (getJSXElementName(path.node) !== localName) return - - if (options.env === 'server') { - path.node.openingElement.attributes = - path.node.openingElement.attributes.filter((item) => { - if ( - t.isJSXAttribute(item) && - t.isJSXIdentifier(item.name, { name: 'fallback' }) - ) { - if (item.value) { - stripBindingsOnlyReferencedBy(path, item.value) - } - state.modified = true - return false - } - - if ( - t.isJSXSpreadAttribute(item) && - t.isObjectExpression(item.argument) - ) { - if ( - stripObjectExpressionProperty( - path, - item.argument, - 'fallback', + const prepend: t.Program['body'] = [] + // Index before mutation so spreads can resolve declarations later in the file. + const objectExpressions = new WeakMap() + walk(options.ast, { + ObjectExpression(node) { + objectExpressions.set(sourceNode(options, node), node) + }, + }) + walk(options.ast, { + JSXElement(node, visitor) { + if (getJSXElementName(node) !== localName) { + return + } + if (options.env === 'server') { + node.openingElement.attributes = node.openingElement.attributes.filter( + (attribute) => { + if ( + is.JSXAttribute(attribute) && + is.JSXIdentifier(attribute.name) && + attribute.name.name === 'fallback' + ) { + transformation.modified = true + return false + } + if (is.JSXSpreadAttribute(attribute)) { + const argument = unwrapExpression(attribute.argument) + const object = is.ObjectExpression(argument) + ? argument + : is.Identifier(argument) + ? getSingleUseObjectExpressionBinding( + options, + argument, + objectExpressions, ) - ) { - state.modified = true - } - return item.argument.properties.length > 0 - } - - if ( - t.isJSXSpreadAttribute(item) && - t.isIdentifier(item.argument) - ) { - const init = getSingleUseObjectExpressionBinding( - path, - item.argument, - ) - if ( - init && - stripObjectExpressionProperty(path, init, 'fallback') - ) { - state.modified = true - } - } - - return true - }) - } - - const split = getBooleanProp(path.node.openingElement, 'split') - if (split === false) return - - const boundaryInspection = inspectSplitBoundary({ - code: options.code, - path, - validate: true, - collectCaptured: options.env === 'client', - ...(options.env === 'client' - ? { - nestedHydrate: { - localName, - }, - } - : {}), - }) - - const index = nextBoundaryIndex - nextBoundaryIndex += 1 + boundaryInspection.nestedBoundaryCount - const id = getBoundaryId(index) - const exportName = `H${index}` - - const existingHydrateId = getJSXAttribute( - path.node.openingElement, - 'h', - ) - if (existingHydrateId) { - existingHydrateId.value = t.stringLiteral(id) - } else { - path.node.openingElement.attributes.push( - t.jsxAttribute(t.jsxIdentifier('h'), t.stringLiteral(id)), - ) - } - state.modified = true - - if (options.env === 'server') return - - const needsPreloadProp = path.node.openingElement.attributes.some( - (attribute) => { - if (t.isJSXAttribute(attribute)) { - return t.isJSXIdentifier(attribute.name, { name: 'prefetch' }) + : undefined + if (object && stripObjectExpressionProperty(object, 'fallback')) { + transformation.modified = true } - - if (t.isJSXSpreadAttribute(attribute)) { - if (t.isObjectExpression(attribute.argument)) { - return objectExpressionMayHaveProperty( - attribute.argument, - 'prefetch', - ) - } - - if (t.isIdentifier(attribute.argument)) { - const init = getSingleUseObjectExpressionBinding( - path, - attribute.argument, - ) - return init - ? objectExpressionMayHaveProperty(init, 'prefetch') - : true - } - - return true + if (is.ObjectExpression(argument)) { + return argument.properties.length > 0 } - - return false - }, + } + return true + }, + ) + } + if (getBooleanProp(node.openingElement, 'split') === false) { + return + } + const inspection = inspectSplitBoundary(options, node, { + code: options.code, + validate: true, + collectCaptured: options.env === 'client', + ...(options.env === 'client' ? { nestedHydrate: { localName } } : {}), + }) + const index = nextBoundaryIndex + nextBoundaryIndex += 1 + inspection.nestedBoundaryCount + const id = getBoundaryId(index) + const exportName = `H${index}` + const existingId = getJSXAttribute(node.openingElement, 'h') + const idValue: t.StringLiteral = { + type: 'Literal', + value: id, + raw: JSON.stringify(id), + start: 0, + end: 0, + } + if (existingId) { + existingId.value = idValue + } else { + node.openingElement.attributes.push( + b.JSXAttribute({ + name: b.JSXIdentifier({ name: 'h' }), + value: idValue, + }), + ) + } + transformation.modified = true + if (options.env === 'server') { + return + } + const needsPreload = node.openingElement.attributes.some((attribute) => { + if (is.JSXAttribute(attribute)) { + return ( + is.JSXIdentifier(attribute.name) && + attribute.name.name === 'prefetch' ) - const childReferenceNodes = getMeaningfulChildren(path.node.children) - - state.extractedChildNodes.push(...childReferenceNodes) - boundaryInspection.captured.forEach((name) => { - state.capturedNames.add(name) - }) - - if (!lazyIdent) { - lazyIdent = - programPath.scope.generateUidIdentifier('lazyRouteComponent') - programPath.unshiftContainer('body', [ - t.importDeclaration( - [ - t.importSpecifier( - lazyIdent, - t.identifier('lazyRouteComponent'), - ), - ], - t.stringLiteral(`@tanstack/${options.framework}-router`), - ), - ]) - } - - const importIdParams = new URLSearchParams() - importIdParams.set(tssHydrate, id) - const componentIdent = - programPath.scope.generateUidIdentifier(exportName) - const declarations = [ - t.variableDeclarator( - componentIdent, - t.callExpression(lazyIdent, [ - t.arrowFunctionExpression( - [], - t.callExpression(t.import(), [ - t.stringLiteral(`${sourceId}?${importIdParams.toString()}`), - ]), - ), - t.stringLiteral(exportName), - ]), - ), - ] - - let preloadIdent: t.Identifier | undefined - if (needsPreloadProp) { - preloadIdent = programPath.scope.generateUidIdentifier( - `${exportName}_preload`, - ) - declarations.push( - t.variableDeclarator( - preloadIdent, - t.memberExpression(componentIdent, t.identifier('preload')), - ), - ) - } - - programPath.unshiftContainer('body', [ - t.variableDeclaration('const', declarations), - ]) - if (preloadIdent) { - path.node.openingElement.attributes.push( - t.jsxAttribute( - t.jsxIdentifier('p'), - t.jsxExpressionContainer(preloadIdent), - ), - ) - } - - path.node.children = [ - t.jsxText('\n'), - t.jsxExpressionContainer( - t.jsxElement( - t.jsxOpeningElement( - t.jsxIdentifier(componentIdent.name), - boundaryInspection.captured.map((name) => - t.jsxAttribute( - t.jsxIdentifier(name), - t.jsxExpressionContainer(t.identifier(name)), - ), - ), - true, - ), - null, - [], - true, - ), - ), - t.jsxText('\n'), - ] - path.skip() - }, + } + const argument = unwrapExpression(attribute.argument) + const object = is.ObjectExpression(argument) + ? argument + : is.Identifier(argument) + ? getSingleUseObjectExpressionBinding( + options, + argument, + objectExpressions, + ) + : undefined + return !object || objectExpressionMayHaveProperty(object, 'prefetch') }) - - if (state.extractedChildNodes.length > 0) { - stripBindingsOnlyReferencedByNodes( - programPath.scope, - state.extractedChildNodes, - new Set(), - state.capturedNames, + if (!lazyName) { + lazyName = fresh('lazyRouteComponent') + prepend.push( + ...parseStatements( + `import { lazyRouteComponent as ${lazyName} } from ${JSON.stringify(`@tanstack/${options.framework}-router`)}`, + ), ) } - - programPath.skip() + const query = new URLSearchParams({ [tssHydrate]: id }) + const componentName = fresh(exportName) + prepend.push( + ...parseStatements( + `const ${componentName} = ${lazyName}(() => import(${JSON.stringify(`${sourceId}?${query}`)}), ${JSON.stringify(exportName)})`, + ), + ) + if (needsPreload) { + const preloadName = fresh(`${exportName}_preload`) + prepend.push( + ...parseStatements(`const ${preloadName} = ${componentName}.preload`), + ) + node.openingElement.attributes.push( + b.JSXAttribute({ + name: b.JSXIdentifier({ name: 'p' }), + value: b.JSXExpressionContainer({ + expression: parseExpression(preloadName), + }), + }), + ) + } + const props = inspection.captured + .map((name) => `${name}={${name}}`) + .join(' ') + const child = parseExpression(`<${componentName} ${props} />`) + node.children = [b.JSXExpressionContainer({ expression: child })] + visitor.skip() }, }) - - if (!state.modified) return null - + if (!transformation.modified) { + return null + } + options.ast.body.unshift(...prepend) return true } function loadHydrateVirtualModule(options: { + module: Module id: string root: string code: string framework: CompileStartFrameworkOptions }) { const { sourceId, splitId, boundaryIndex } = parseHydrateVirtualId(options.id) - if (!splitId || boundaryIndex < 0) return null - const getBoundaryId = createBoundaryId(options.root, sourceId) - - const ast = parseAst({ code: options.code, sourceFilename: sourceId }) + if (!splitId || boundaryIndex < 0) { + return null + } + const module = options.module + const { program: ast, originalNodes } = cloneModuleAst(module) + const context = { ast, module, originalNodes } const hydrateImport = getHydrateImport(ast, options.framework) - if (!hydrateImport) return null - const { hydrateLocalName: localName } = hydrateImport - + if (!hydrateImport) { + return null + } + const getBoundaryId = createBoundaryId(options.root, sourceId) let target: t.JSXElement | undefined - let targetIndex = -1 - let targetCaptured: Array = [] + let captures: Array = [] let index = 0 - - babel.traverse(ast, { - JSXElement(path) { - if (getJSXElementName(path.node) !== localName) return - const split = getBooleanProp(path.node.openingElement, 'split') - if (split === false) return - + walk(ast, { + JSXElement(node, visitor) { + if ( + getJSXElementName(node) !== hydrateImport.hydrateLocalName || + getBooleanProp(node.openingElement, 'split') === false + ) { + return + } if (index === boundaryIndex) { - const id = getBoundaryId(index) - if (id !== splitId) { - path.stop() - return + if (getBoundaryId(index) === splitId) { + target = node + captures = inspectSplitBoundary(context, node, { + code: options.code, + collectCaptured: true, + }).captured } - targetCaptured = inspectSplitBoundary({ - code: options.code, - path, - collectCaptured: true, - }).captured - target = t.cloneNode(path.node, true) - targetIndex = index - path.stop() - return + visitor.stop() } index++ }, }) - - if (!target || targetIndex < 0) return null - - const children = target.children - const exportName = `H${targetIndex}` - const refIdents = findReferencedIdentifiers(ast) - - removeModuleLevelBindings(ast, new Set(['Route'])) - const localBindings = new Set() - for (const node of ast.program.body) { - collectLocalBindingsFromStatement(node, localBindings) + if (!target) { + return null } - - const keepBindings = new Set() - const meaningfulChildren = getMeaningfulChildren(children) - let returnExpression: t.Expression | t.JSXElement | t.JSXFragment = - t.nullLiteral() - - if (meaningfulChildren.length === 1) { - const child = meaningfulChildren[0]! - if (t.isJSXExpressionContainer(child)) { - returnExpression = t.isJSXEmptyExpression(child.expression) - ? t.nullLiteral() + const children = getMeaningfulChildren(target.children) + let expression: t.Expression = b.Literal({ value: null, raw: 'null' }) + if (children.length === 1) { + const child = children[0]! + if (is.JSXExpressionContainer(child)) { + expression = is.JSXEmptyExpression(child.expression) + ? expression : child.expression - } else if (t.isJSXElement(child) || t.isJSXFragment(child)) { - returnExpression = child - } else if (t.isJSXText(child)) { - returnExpression = t.stringLiteral(child.value) + } else if (is.JSXText(child)) { + expression = b.Literal({ + value: child.value, + raw: JSON.stringify(child.value), + }) + } else if (is.JSXElement(child) || is.JSXFragment(child)) { + expression = child } - } else if (meaningfulChildren.length > 1) { - returnExpression = t.jsxFragment( - t.jsxOpeningFragment(), - t.jsxClosingFragment(), - children, - ) + } else if (children.length > 1) { + expression = b.JSXFragment({ + openingFragment: b.JSXOpeningFragment({}), + closingFragment: b.JSXClosingFragment({}), + children: target.children, + }) } - for (const name of collectIdentifiersFromNode(returnExpression)) { - if (localBindings.has(name)) { - keepBindings.add(name) + const graph = moduleDeclarationGraph(module) + const keep = new Set() + for (const child of children) { + for (const symbol of collectModuleReferences( + module, + sourceNode(context, child), + )) { + if (symbol.name !== 'Route') { + keep.add(symbol) + } } } - - if (keepBindings.size > 0) { - expandTransitively( - keepBindings, - buildDependencyGraph(buildDeclarationMap(ast), localBindings), - ) - } - - retainModuleLevelDeclarations(ast, keepBindings) - unwrapExportedDeclarations(ast) - - ast.program.body.push( - t.exportNamedDeclaration( - t.functionDeclaration( - t.identifier(exportName), - targetCaptured.length > 0 - ? [ - t.objectPattern( - targetCaptured.map((name) => - t.objectProperty( - t.identifier(name), - t.identifier(name), - false, - true, - ), - ), - ), - ] - : [], - t.blockStatement([t.returnStatement(returnExpression)]), - ), - ), + const retained = expandTransitively(keep, graph.dependencies) + const selected = new Set( + [...graph.declarationSymbols] + .filter(([, owners]) => + [...owners].some((symbol) => retained.has(symbol)), + ) + .map(([declaration]) => declaration), ) - - deadCodeElimination(ast, refIdents) - stripUnreferencedTopLevelExpressionStatements(ast) - - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: options.id, - filename: options.id, + ast.body = ast.body.flatMap((statement): t.Program['body'] => { + if (is.ImportDeclaration(statement)) { + return [statement] + } + const declaration = + is.ExportNamedDeclaration(statement) || + is.ExportDefaultDeclaration(statement) + ? statement.declaration + : statement + if (is.VariableDeclaration(declaration)) { + declaration.declarations = declaration.declarations.filter((item) => + selected.has(sourceNode(context, item)), + ) + return declaration.declarations.length ? [declaration] : [] + } + if ( + (is.FunctionDeclaration(declaration) || + is.ClassDeclaration(declaration) || + is.TSDeclareFunction(declaration) || + is.TSModuleDeclaration(declaration) || + is.TSEnumDeclaration(declaration)) && + selected.has(sourceNode(context, declaration)) + ) { + return [declaration] + } + return [] + }) + const params = captures.length ? `{ ${captures.join(', ')} }` : '' + const output = parseStatements( + `export function H${boundaryIndex}(${params}) { return null; }`, + )[0]! + walk(output, { + ReturnStatement(node) { + node.argument = expression + }, }) - return result + ast.body.push(output) + removeUnusedBindings(module, ast, originalNodes, { + preserveInitiallyUnused: false, + }) + return generateModule(ast, { source: options.code, filename: options.id }) } - export function createHydrateCompilerPlugin(): StartCompilerPlugin { type SourceEntry = { + module: Module code: string framework: CompileStartFrameworkOptions virtualModules: Map @@ -907,6 +655,7 @@ export function createHydrateCompilerPlugin(): StartCompilerPlugin { id: string, code: string, framework: CompileStartFrameworkOptions, + sourceModule?: Module, ) => { const sourceId = cleanId(id) const sources = getEnvironmentSources(envName) @@ -916,6 +665,7 @@ export function createHydrateCompilerPlugin(): StartCompilerPlugin { } const entry = { + module: sourceModule ?? analyzeModule({ code, filename: sourceId }), code, framework, virtualModules: new Map(), @@ -943,6 +693,8 @@ export function createHydrateCompilerPlugin(): StartCompilerPlugin { : virtualModule.boundaryIndex + 1 const result = transformHydrateAst({ ast: context.ast, + module: context.module, + originalNodes: context.originalNodes, code: context.code, id: context.id, root: context.root, @@ -952,7 +704,13 @@ export function createHydrateCompilerPlugin(): StartCompilerPlugin { }) if (result && virtualModule.boundaryIndex < 0) { - setSource(context.envName, context.id, context.code, context.framework) + setSource( + context.envName, + context.id, + context.code, + context.framework, + context.module, + ) } return !!result @@ -989,6 +747,7 @@ export function createHydrateCompilerPlugin(): StartCompilerPlugin { } const result = loadHydrateVirtualModule({ + module: sourceEntry.module, code: sourceEntry.code, id: context.id, root: context.root, diff --git a/packages/start-plugin-core/src/import-protection/INTERNALS.md b/packages/start-plugin-core/src/import-protection/INTERNALS.md index 4f19e4bd7ea..22e5d88ed6d 100644 --- a/packages/start-plugin-core/src/import-protection/INTERNALS.md +++ b/packages/start-plugin-core/src/import-protection/INTERNALS.md @@ -7,7 +7,7 @@ Start import protection. Its current structure is: -- parse module code once per `TransformResult` +- parse and resolve module bindings once per `TransformResult` with Yuku - derive a read-only `ImportAnalysis` object from that AST - reuse that analysis for source extraction, import-specifier locations, mock export discovery, named export discovery, and usage lookup @@ -27,7 +27,7 @@ It builds and caches `ImportAnalysis` on `TransformResult.analysis`. `ImportAnalysis` contains: -- parsed AST +- immutable Yuku module with AST and resolved references - line index - import sources in source order - import specifier literal locations @@ -151,7 +151,6 @@ It includes: - `export ... from 'x'` - `export * from 'x'` - `import('x')` -- dynamic import call forms supported by Babel's AST shape Adapter code that needs source extraction should call into `analysis.ts` directly. @@ -188,11 +187,11 @@ handle default export separately. Usage lookup is shared across adapters through `analysis.ts`. -The walker: +The usage lookup: -- tracks lexical/program/block/function bindings manually -- respects shadowing across nested scopes, block bindings, function params, and - `catch` params +- queries Yuku's resolved runtime references instead of approximating scopes +- identifies imports by symbol identity, including shadowing across nested scopes, + block bindings, function params, and `catch` params - treats certain compiler-recognized boundaries as safe when looking for original unsafe usage @@ -217,7 +216,7 @@ Analysis and rewrite are intentionally separate. Reasons: - adapters frequently need inspection without mutation -- mutation wants a fresh, isolated AST/codegen pass +- mutation uses a cloned output AST and Yuku code generation with source maps - read-only analysis is much easier to cache safely - source-location helpers and usage lookup should not depend on whether a module was rewritten diff --git a/packages/start-plugin-core/src/import-protection/analysis.ts b/packages/start-plugin-core/src/import-protection/analysis.ts index 85f90b0a87e..6278423a6ba 100644 --- a/packages/start-plugin-core/src/import-protection/analysis.ts +++ b/packages/start-plugin-core/src/import-protection/analysis.ts @@ -1,27 +1,18 @@ -import * as t from '@babel/types' -import { parseAst } from '@tanstack/router-utils' - -import { buildLineIndex } from './sourceLocation' +import { analyzeModule, unwrapExpression } from '@tanstack/router-utils' +import { bindingIdentifiers, is } from 'yuku-ast' +import { buildLineIndex, indexToLineColumn } from './sourceLocation' import { getOrCreate } from './utils' +import type * as t from '@yuku-toolchain/types' +import type { Module, Symbol } from 'yuku-analyzer' import type { LineIndex, TransformResult } from './sourceLocation' -import type { ParseAstResult } from '@tanstack/router-utils' export type UsagePos = { line: number; column0: number } - type BoundaryEnv = 'client' | 'server' - -type ImportBindingInfo = { - importedLocalNames: Set -} - +type ImportBindingInfo = { importedLocalNames: Set } type UsageCacheKey = `${BoundaryEnv | 'post'}::${string}` -function mayContainImportOrExport(code: string): boolean { - return code.includes('import') || code.includes('export') -} - export type ImportAnalysis = { - ast: ParseAstResult + module: Module lineIndex: LineIndex importSourcesInOrder: Array importSpecifierLocationIndex: Map @@ -31,38 +22,38 @@ export type ImportAnalysis = { usageByKey: Map } +function mayContainImportOrExport(code: string): boolean { + return code.includes('import') || code.includes('export') +} + function makeTransientResult( code: string, filename?: string, perf?: TransformResult['perf'], ): TransformResult { - const result: TransformResult = { + return { code, filename, map: undefined, originalCode: undefined, + ...(perf ? { perf } : {}), } - - if (perf) { - result.perf = perf - } - - return result } -function getOrParseAst(result: TransformResult): ParseAstResult { - if (result.parsedAst) { +function getOrAnalyzeModule(result: TransformResult): Module { + if (result.analyzedModule) { result.perf?.count('analysis.parseAst.cached') - return result.parsedAst + return result.analyzedModule } - const startedAt = result.perf ? performance.now() : 0 result.perf?.count('analysis.parseAst.calls') - try { - const ast = parseAst({ code: result.code, filename: result.filename }) - result.parsedAst = ast - return ast + const module = analyzeModule({ + code: result.code, + filename: result.filename, + }) + result.analyzedModule = module + return module } finally { if (result.perf) { result.perf.time('analysis.parseAst', startedAt) @@ -70,107 +61,52 @@ function getOrParseAst(result: TransformResult): ParseAstResult { } } +function unwrapNode(node: t.Node): t.Node { + return is.Expression(node) ? unwrapExpression(node) : node +} + function getModuleExportName(node: t.Identifier | t.StringLiteral): string { - return t.isIdentifier(node) ? node.name : node.value + return is.Identifier(node) ? node.name : node.value } function getStringLiteralValueStart(node: t.StringLiteral): number { - if (node.start == null) { - return -1 - } - - const raw = node.extra?.raw - if (typeof raw === 'string' && (raw.startsWith("'") || raw.startsWith('"'))) { - return node.start + 1 - } - - return node.start + return node.start + 1 } function isTypeOnlyImportDeclaration(node: t.ImportDeclaration): boolean { - if (node.importKind === 'type') return true - if (node.specifiers.length === 0) return false - - return node.specifiers.every( - (specifier) => - t.isImportSpecifier(specifier) && specifier.importKind === 'type', + return ( + node.importKind === 'type' || + (node.specifiers.length > 0 && + node.specifiers.every( + (specifier) => + is.ImportSpecifier(specifier) && specifier.importKind === 'type', + )) ) } function isTypeOnlyExportNamedDeclaration( node: t.ExportNamedDeclaration, ): boolean { - if (node.exportKind === 'type') return true - if (!node.source || node.declaration || node.specifiers.length === 0) { - return false - } - - return node.specifiers.every( - (specifier) => - t.isExportSpecifier(specifier) && specifier.exportKind === 'type', + return ( + node.exportKind === 'type' || + (!!node.source && + !node.declaration && + node.specifiers.length > 0 && + node.specifiers.every((specifier) => specifier.exportKind === 'type')) ) } -function collectIdentifiersFromPattern( - pattern: t.LVal, - add: (name: string) => void, -): void { - if (t.isIdentifier(pattern)) { - add(pattern.name) - } else if (t.isObjectPattern(pattern)) { - for (const prop of pattern.properties) { - if (t.isRestElement(prop)) { - collectIdentifiersFromPattern(prop.argument as t.LVal, add) - } else { - collectIdentifiersFromPattern(prop.value as t.LVal, add) - } - } - } else if (t.isArrayPattern(pattern)) { - for (const elem of pattern.elements) { - if (elem) collectIdentifiersFromPattern(elem as t.LVal, add) - } - } else if (t.isAssignmentPattern(pattern)) { - collectIdentifiersFromPattern(pattern.left, add) - } else if (t.isRestElement(pattern)) { - collectIdentifiersFromPattern(pattern.argument as t.LVal, add) - } -} - export function isValidExportName(name: string): boolean { - if (name === 'default' || name.length === 0) return false - const first = name.charCodeAt(0) - if ( - !( - (first >= 65 && first <= 90) || - (first >= 97 && first <= 122) || - first === 95 || - first === 36 - ) - ) - return false - for (let i = 1; i < name.length; i++) { - const ch = name.charCodeAt(i) - if ( - !( - (ch >= 65 && ch <= 90) || - (ch >= 97 && ch <= 122) || - (ch >= 48 && ch <= 57) || - ch === 95 || - ch === 36 - ) - ) - return false - } - return true + return name !== 'default' && /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) } function buildImportAnalysis(result: TransformResult): ImportAnalysis { - const ast = getOrParseAst(result) + const module = getOrAnalyzeModule(result) const importSourcesInOrder: Array = [] const importSpecifierLocationIndex = new Map() const importBindingsBySource = new Map() - const memberBindingSources = new Map>() + const memberBindingSources = new Map>() const mockNamesBySource = new Map>() const namedExports = new Set() @@ -183,10 +119,6 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { importSourcesInOrder.push(node.value) const index = getStringLiteralValueStart(node) - if (index === -1) { - return - } - const prev = importSpecifierLocationIndex.get(node.value) if (prev == null || index < prev) { importSpecifierLocationIndex.set(node.value, index) @@ -194,14 +126,19 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { } const addMockName = (source: string, name: string) => { - if (name === 'default' || name.length === 0) return + if (name === 'default' || name.length === 0) { + return + } getOrCreate(mockNamesBySource, source, () => new Set()).add(name) } const addMemberBinding = (localName: string, source: string) => { - getOrCreate(memberBindingSources, localName, () => new Set()).add( - source, - ) + const symbol = module.rootScope.find(localName) + if (symbol) { + getOrCreate(memberBindingSources, symbol, () => new Set()).add( + source, + ) + } } const addNamedExport = (name: string) => { @@ -211,27 +148,31 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { } const visit = (node: t.Node): void => { - if (t.isImportDeclaration(node)) { + if (is.ImportDeclaration(node)) { const isTypeOnly = isTypeOnlyImportDeclaration(node) if (!isTypeOnly) { addSpecifierLocation(node.source) const source = node.source.value const bindingInfo = getBindingInfo(source) for (const specifier of node.specifiers) { - if (t.isImportNamespaceSpecifier(specifier)) { + if (is.ImportNamespaceSpecifier(specifier)) { bindingInfo.importedLocalNames.add(specifier.local.name) addMemberBinding(specifier.local.name, source) continue } - if (t.isImportDefaultSpecifier(specifier)) { + if (is.ImportDefaultSpecifier(specifier)) { bindingInfo.importedLocalNames.add(specifier.local.name) addMemberBinding(specifier.local.name, source) continue } - if (!t.isImportSpecifier(specifier)) continue - if (specifier.importKind === 'type') continue + if (!is.ImportSpecifier(specifier)) { + continue + } + if (specifier.importKind === 'type') { + continue + } bindingInfo.importedLocalNames.add(specifier.local.name) const importedName = getModuleExportName(specifier.imported) @@ -240,17 +181,21 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { } } } - } else if (t.isExportNamedDeclaration(node)) { + } else if (is.ExportNamedDeclaration(node)) { const isTypeOnly = isTypeOnlyExportNamedDeclaration(node) - if (!isTypeOnly && node.source && t.isStringLiteral(node.source)) { + if (!isTypeOnly && node.source && is.StringLiteral(node.source)) { addSpecifierLocation(node.source) } if (!isTypeOnly && node.source?.value) { const source = node.source.value for (const specifier of node.specifiers) { - if (!t.isExportSpecifier(specifier)) continue - if (specifier.exportKind === 'type') continue + if (!is.ExportSpecifier(specifier)) { + continue + } + if (specifier.exportKind === 'type') { + continue + } addMockName(source, getModuleExportName(specifier.local)) } } @@ -258,72 +203,56 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { if (!isTypeOnly) { if (node.declaration) { const decl = node.declaration - if (t.isFunctionDeclaration(decl) || t.isClassDeclaration(decl)) { - if (decl.id?.name) addNamedExport(decl.id.name) - } else if (t.isVariableDeclaration(decl)) { + if (is.FunctionDeclaration(decl) || is.ClassDeclaration(decl)) { + if (decl.id?.name) { + addNamedExport(decl.id.name) + } + } else if (is.VariableDeclaration(decl)) { for (const d of decl.declarations) { - collectIdentifiersFromPattern(d.id as t.LVal, addNamedExport) + bindingIdentifiers(d.id).forEach((id) => addNamedExport(id.name)) } } } for (const specifier of node.specifiers) { - if (!t.isExportSpecifier(specifier)) continue - if (specifier.exportKind === 'type') continue + if (!is.ExportSpecifier(specifier)) { + continue + } + if (specifier.exportKind === 'type') { + continue + } const exportedName = getModuleExportName(specifier.exported) addNamedExport(exportedName) } } - } else if (t.isExportAllDeclaration(node)) { + } else if (is.ExportAllDeclaration(node)) { if (node.exportKind !== 'type') { addSpecifierLocation(node.source) } - } else if (t.isImportExpression(node)) { - if (t.isStringLiteral(node.source)) { - addSpecifierLocation(node.source) - } - } else if (t.isCallExpression(node) && t.isImport(node.callee)) { - const sourceNode = node.arguments[0] - if (t.isStringLiteral(sourceNode)) { - addSpecifierLocation(sourceNode) + } else if (is.ImportExpression(node)) { + const source = unwrapNode(node.source) + if (is.StringLiteral(source)) { + addSpecifierLocation(source) } - } else if ( - t.isMemberExpression(node) || - t.isOptionalMemberExpression(node) - ) { - const object = node.object - if (t.isIdentifier(object)) { - const sources = memberBindingSources.get(object.name) + } else if (is.MemberExpression(node)) { + const object = unwrapNode(node.object) + if (is.Identifier(object)) { + const sources = memberBindingSources.get(module.symbolOf(object)!) if (sources) { const property = node.property for (const source of sources) { - if (!node.computed && t.isIdentifier(property)) { + if (!node.computed && is.Identifier(property)) { addMockName(source, property.name) - } else if (node.computed && t.isStringLiteral(property)) { + } else if (node.computed && is.StringLiteral(property)) { addMockName(source, property.value) } } } } } - - const keys = t.VISITOR_KEYS[node.type] - if (!keys) return - for (const key of keys) { - const child = (node as unknown as Record)[key] - if (Array.isArray(child)) { - for (const item of child) { - if (item && typeof item === 'object' && 'type' in item) { - visit(item as t.Node) - } - } - } else if (child && typeof child === 'object' && 'type' in child) { - visit(child as t.Node) - } - } } - visit(ast.program) + module.walk({ enter: visit }) const mockExportNamesBySource = new Map>() for (const [source, names] of mockNamesBySource) { @@ -334,7 +263,7 @@ function buildImportAnalysis(result: TransformResult): ImportAnalysis { result.lineIndex = lineIndex const analysis = { - ast, + module, lineIndex, importSourcesInOrder, importSpecifierLocationIndex, @@ -418,27 +347,29 @@ export function getNamedExports( function isCompilerSafeBoundaryCall( call: t.CallExpression, - fnNode: t.Function, + fnNode: t.Function | t.ArrowFunctionExpression, envType: BoundaryEnv, ): boolean { - const directArgument = call.arguments.some((arg) => arg === fnNode) + const directArgument = call.arguments.some( + (arg) => unwrapNode(arg) === fnNode, + ) if (!directArgument) { return false } - const callee = call.callee + const callee = unwrapNode(call.callee) - if (t.isIdentifier(callee)) { + if (is.Identifier(callee)) { return envType === 'client' ? callee.name === 'createServerOnlyFn' : callee.name === 'createClientOnlyFn' } - if (!t.isMemberExpression(callee) || callee.computed) { + if (!is.MemberExpression(callee) || callee.computed) { return false } - if (!t.isIdentifier(callee.property)) { + if (!is.Identifier(callee.property)) { return false } @@ -468,235 +399,50 @@ function isCompilerSafeBoundaryCall( return false } -function getCalleeRootName( - node: t.Expression | t.Super | t.V8IntrinsicIdentifier, -): string | undefined { - if (t.isIdentifier(node)) { +function getCalleeRootName(node: t.Node): string | undefined { + node = unwrapNode(node) + if (is.Identifier(node)) { return node.name } - if (t.isCallExpression(node)) { + if (is.CallExpression(node)) { return getCalleeRootName(node.callee) } - if (t.isMemberExpression(node)) { + if (is.MemberExpression(node)) { return getCalleeRootName(node.object) } return undefined } -function getBoundNamesFromPattern(pattern: t.LVal, out: Set): void { - if (t.isIdentifier(pattern)) { - out.add(pattern.name) - } else if (t.isObjectPattern(pattern)) { - for (const prop of pattern.properties) { - if (t.isRestElement(prop)) { - getBoundNamesFromPattern(prop.argument as t.LVal, out) - } else { - getBoundNamesFromPattern(prop.value as t.LVal, out) - } - } - } else if (t.isArrayPattern(pattern)) { - for (const elem of pattern.elements) { - if (elem) getBoundNamesFromPattern(elem as t.LVal, out) - } - } else if (t.isAssignmentPattern(pattern)) { - getBoundNamesFromPattern(pattern.left, out) - } else if (t.isRestElement(pattern)) { - getBoundNamesFromPattern(pattern.argument as t.LVal, out) - } -} - -function addPatternBindingsIfTracked( - pattern: t.LVal, - tracked: Set, - out: Set, -): void { - const names = new Set() - getBoundNamesFromPattern(pattern, names) - for (const name of names) { - if (tracked.has(name)) { - out.add(name) - } +function transparentParent(module: Module, node: t.Node) { + let parent = module.parentOf(node) + while (parent && unwrapNode(parent) === unwrapNode(node)) { + node = parent + parent = module.parentOf(node) } + return { node, parent } } -function collectHoistedVarBindings( +function isInsideCompilerSafeBoundary( + module: Module, node: t.Node, - tracked: Set, - out: Set, - isRoot = true, -): void { - if (!isRoot && t.isFunction(node)) { - return - } - - if (t.isVariableDeclaration(node) && node.kind === 'var') { - for (const decl of node.declarations) { - addPatternBindingsIfTracked(decl.id as t.LVal, tracked, out) - } - } - - const keys = t.VISITOR_KEYS[node.type] - if (!keys) return - for (const key of keys) { - const child = (node as unknown as Record)[key] - if (Array.isArray(child)) { - for (const item of child) { - if (item && typeof item === 'object' && 'type' in item) { - collectHoistedVarBindings(item as t.Node, tracked, out, false) - } - } - } else if (child && typeof child === 'object' && 'type' in child) { - collectHoistedVarBindings(child as t.Node, tracked, out, false) - } - } -} - -function collectProgramBindings( - program: t.Program, - tracked: Set, -): Set { - const bindings = new Set() - - for (const node of program.body) { - if (t.isVariableDeclaration(node)) { - for (const decl of node.declarations) { - addPatternBindingsIfTracked(decl.id as t.LVal, tracked, bindings) - } - continue - } - - if (t.isFunctionDeclaration(node) || t.isClassDeclaration(node)) { - if (node.id && tracked.has(node.id.name)) { - bindings.add(node.id.name) - } - } - } - - return bindings -} - -function collectBlockBindings( - block: t.BlockStatement, - tracked: Set, -): Set { - const bindings = new Set() - - for (const node of block.body) { - if (t.isVariableDeclaration(node) && node.kind !== 'var') { - for (const decl of node.declarations) { - addPatternBindingsIfTracked(decl.id as t.LVal, tracked, bindings) - } - continue - } - - if (t.isFunctionDeclaration(node) || t.isClassDeclaration(node)) { - if (node.id && tracked.has(node.id.name)) { - bindings.add(node.id.name) - } - } - } - - return bindings -} - -function collectFunctionBindings( - fn: t.Function, - tracked: Set, -): Set { - const bindings = new Set() - - if ( - (t.isFunctionDeclaration(fn) || t.isFunctionExpression(fn)) && - fn.id && - tracked.has(fn.id.name) - ) { - bindings.add(fn.id.name) - } - - for (const param of fn.params) { - addPatternBindingsIfTracked(param as t.LVal, tracked, bindings) - } - - if (t.isBlockStatement(fn.body)) { - collectHoistedVarBindings(fn.body, tracked, bindings) - } - - return bindings -} - -type UsageWalkContext = { - parents: Array - scopeStack: Array> -} - -function isShadowedByScope( - name: string, - scopeStack: Array>, -): boolean { - for (let i = scopeStack.length - 1; i >= 0; i--) { - if (scopeStack[i]?.has(name)) { - return true - } - } - return false -} - -function isBindingIdentifierInParent( - node: t.Identifier, - parent: t.Node | undefined, -): boolean { - if (!parent) return false - - if (t.isImportSpecifier(parent) || t.isImportDefaultSpecifier(parent)) { - return parent.local === node - } - if (t.isImportNamespaceSpecifier(parent)) { - return parent.local === node - } - if (t.isFunctionDeclaration(parent) || t.isFunctionExpression(parent)) { - return ( - parent.id === node || parent.params.includes(node as unknown as t.Pattern) - ) - } - if (t.isArrowFunctionExpression(parent)) { - return parent.params.includes(node as unknown as t.Pattern) - } - if (t.isClassDeclaration(parent) || t.isClassExpression(parent)) { - return parent.id === node - } - if (t.isVariableDeclarator(parent)) { - return parent.id === node - } - if (t.isCatchClause(parent)) { - return parent.param === node - } - - return false -} - -function isInsideCompilerSafeBoundaryNodes( - parents: Array, envType: BoundaryEnv, ): boolean { - for (let i = parents.length - 1; i >= 0; i--) { - const node = parents[i]! - if (!t.isFunction(node)) { - continue - } - - const call = parents[i - 1] - if ( - call && - t.isCallExpression(call) && - isCompilerSafeBoundaryCall(call, node, envType) - ) { - return true + let ancestor = module.parentOf(node) + while (ancestor) { + if (is.Function(ancestor)) { + const { parent: call } = transparentParent(module, ancestor) + if ( + is.CallExpression(call) && + isCompilerSafeBoundaryCall(call, ancestor, envType) + ) { + return true + } } + ancestor = module.parentOf(ancestor) } - return false } @@ -710,191 +456,46 @@ function findUsagePosInAnalysis( if (analysis.usageByKey.has(cacheKey)) { return analysis.usageByKey.get(cacheKey) ?? undefined } - + const module = analysis.module const imported = analysis.importBindingsBySource.get(source)?.importedLocalNames - if (!imported || imported.size === 0) { - analysis.usageByKey.set(cacheKey, null) - return undefined + const symbols = new Set() + for (const name of imported ?? []) { + const symbol = module.rootScope.find(name) + if (symbol) { + symbols.add(symbol) + } } - let preferred: UsagePos | undefined let anyUsage: UsagePos | undefined - - const visit = (node: t.Node, ctx: UsageWalkContext): void => { - if (preferred && anyUsage) { - return - } - - if (t.isProgram(node)) { - const nextCtx = { - parents: [...ctx.parents, node], - scopeStack: [...ctx.scopeStack, collectProgramBindings(node, imported)], - } - for (const child of node.body) { - visit(child, nextCtx) - } - return - } - - if (t.isFunction(node)) { - const functionCtx = { - parents: [...ctx.parents, node], - scopeStack: [ - ...ctx.scopeStack, - collectFunctionBindings(node, imported), - ], - } - - visit(node.body, functionCtx) - return - } - - if (t.isBlockStatement(node)) { - const nextCtx = { - parents: [...ctx.parents, node], - scopeStack: [...ctx.scopeStack, collectBlockBindings(node, imported)], - } - for (const child of node.body) { - visit(child, nextCtx) - } - return - } - - if (t.isCatchClause(node)) { - const bindings = new Set() - if (node.param) { - addPatternBindingsIfTracked(node.param as t.LVal, imported, bindings) - } - const nextCtx = { - parents: [...ctx.parents, node], - scopeStack: bindings.size - ? [...ctx.scopeStack, bindings] - : ctx.scopeStack, - } - visit(node.body, nextCtx) - return - } - - if ( - t.isForStatement(node) && - t.isVariableDeclaration(node.init) && - node.init.kind !== 'var' - ) { - const bindings = new Set() - for (const decl of node.init.declarations) { - addPatternBindingsIfTracked(decl.id as t.LVal, imported, bindings) - } - const nextCtx = { - parents: [...ctx.parents, node], - scopeStack: bindings.size - ? [...ctx.scopeStack, bindings] - : ctx.scopeStack, - } - visit(node.init, nextCtx) - if (node.test) visit(node.test, nextCtx) - if (node.update) visit(node.update, nextCtx) - visit(node.body, nextCtx) - return - } - + for (const reference of module.references) { if ( - (t.isForInStatement(node) || t.isForOfStatement(node)) && - t.isVariableDeclaration(node.left) && - node.left.kind !== 'var' + !reference.symbol || + !symbols.has(reference.symbol) || + reference.inTypePosition ) { - const bindings = new Set() - for (const decl of node.left.declarations) { - addPatternBindingsIfTracked(decl.id as t.LVal, imported, bindings) - } - const nextCtx = { - parents: [...ctx.parents, node], - scopeStack: bindings.size - ? [...ctx.scopeStack, bindings] - : ctx.scopeStack, - } - visit(node.left, nextCtx) - visit(node.right, nextCtx) - visit(node.body, nextCtx) - return + continue } - - const nextParents = [...ctx.parents, node] - - if (t.isIdentifier(node)) { - const parent = ctx.parents[ctx.parents.length - 1] - if (imported.has(node.name)) { - if (!isBindingIdentifierInParent(node, parent)) { - if ( - !( - t.isObjectProperty(parent) && - parent.key === node && - !parent.computed && - !parent.shorthand - ) && - !( - t.isObjectMethod(parent) && - parent.key === node && - !parent.computed - ) && - !(t.isExportSpecifier(parent) && parent.exported === node) && - !isShadowedByScope(node.name, ctx.scopeStack) && - !( - envType && isInsideCompilerSafeBoundaryNodes(ctx.parents, envType) - ) - ) { - const loc = node.loc?.start - if (loc) { - const pos: UsagePos = { line: loc.line, column0: loc.column } - const isPreferred = - (t.isCallExpression(parent) && parent.callee === node) || - (t.isNewExpression(parent) && parent.callee === node) || - ((t.isMemberExpression(parent) || - t.isOptionalMemberExpression(parent)) && - parent.object === node) - - if (isPreferred) { - preferred ||= pos - } else { - anyUsage ||= pos - } - } - } - } - } + const node = reference.node + if (envType && isInsideCompilerSafeBoundary(module, node, envType)) { + continue } - - if (t.isImportDeclaration(node)) { - return + const { node: expression, parent } = transparentParent(module, node) + const { line, column } = indexToLineColumn(analysis.lineIndex, node.start) + const pos = { line, column0: column - 1 } + const isPreferred = + ((is.CallExpression(parent) || is.NewExpression(parent)) && + parent.callee === expression) || + (is.MemberExpression(parent) && parent.object === expression) + if (isPreferred) { + preferred ??= pos + } else { + anyUsage ??= pos } - - const keys = t.VISITOR_KEYS[node.type] - if (!keys) return - for (const key of keys) { - const child = (node as unknown as Record)[key] - if (Array.isArray(child)) { - for (const item of child) { - if (item && typeof item === 'object' && 'type' in item) { - visit(item as t.Node, { - parents: nextParents, - scopeStack: ctx.scopeStack, - }) - } - } - } else if (child && typeof child === 'object' && 'type' in child) { - visit(child as t.Node, { - parents: nextParents, - scopeStack: ctx.scopeStack, - }) - } + if (preferred && anyUsage) { + break } } - - visit(analysis.ast.program, { - parents: [], - scopeStack: [], - }) - const pos = preferred ?? anyUsage ?? null analysis.usageByKey.set(cacheKey, pos) return pos ?? undefined diff --git a/packages/start-plugin-core/src/import-protection/rewrite.ts b/packages/start-plugin-core/src/import-protection/rewrite.ts index fb7e1904763..ed09fa0bbeb 100644 --- a/packages/start-plugin-core/src/import-protection/rewrite.ts +++ b/packages/start-plugin-core/src/import-protection/rewrite.ts @@ -1,226 +1,119 @@ -import * as t from '@babel/types' -import { generateFromAst, parseAst } from '@tanstack/router-utils' - +import { + analyzeModule, + cloneModuleAst, + generateModule, + parseStatements, +} from '@tanstack/router-utils' +import { is, isValidIdentifier, nameOf } from 'yuku-ast' import { MOCK_MODULE_ID } from './constants' import type { SourceMapLike } from './sourceLocation' -import type { ParseAstResult } from '@tanstack/router-utils' - -function getModuleExportName(node: t.Identifier | t.StringLiteral): string { - return t.isIdentifier(node) ? node.name : node.value -} -function toMemberExpressionProperty(name: string): { - property: t.Identifier | t.StringLiteral - computed: boolean -} { - return t.isValidIdentifier(name) - ? { property: t.identifier(name), computed: false } - : { property: t.stringLiteral(name), computed: true } +function memberAccess(object: string, name: string): string { + return isValidIdentifier(name) + ? `${object}.${name}` + : `${object}[${JSON.stringify(name)}]` } -function toModuleExportNameNode(name: string): t.Identifier | t.StringLiteral { - return t.isValidIdentifier(name) ? t.identifier(name) : t.stringLiteral(name) -} - -function createInternalReexportVarName( - localName: string, - mockIndex: number, - usedNames: Set, -): string { - const baseName = t.isValidIdentifier(localName) - ? `__tss_reexport_${localName}` - : `__tss_reexport_${mockIndex}` - - let candidate = baseName - let suffix = 0 - while (usedNames.has(candidate)) { - suffix++ - candidate = `${baseName}_${suffix}` - } - - usedNames.add(candidate) - return candidate +function exportName(name: string): string { + return isValidIdentifier(name) ? name : JSON.stringify(name) } -/** - * Rewrite static imports/re-exports from denied sources using Babel AST transforms. - * - * Transforms: - * import { a as b, c } from 'denied' - * Into: - * import __tss_deny_0 from 'tanstack-start-import-protection:mock' - * const b = __tss_deny_0.a - * const c = __tss_deny_0.c - * - * Also handles: - * import def from 'denied' -> import def from mock - * import * as ns from 'denied' -> import ns from mock - * export { x } from 'denied' -> export const x = mock.x - * export * from 'denied' -> removed - * export { x as y } from 'denied' -> export const y = mock.x - */ +/** Rewrite denied static edges using one source analysis and an isolated output AST. */ export function rewriteDeniedImports( code: string, id: string, deniedSources: Set, getMockModuleId: (source: string) => string = () => MOCK_MODULE_ID, ): { code: string; map?: SourceMapLike } | undefined { - return rewriteDeniedImportsFromAst( - parseAst({ code, filename: id }), - id, - deniedSources, - getMockModuleId, - ) -} - -function rewriteDeniedImportsFromAst( - ast: ParseAstResult, - id: string, - deniedSources: Set, - getMockModuleId: (source: string) => string = () => MOCK_MODULE_ID, -): { code: string; map?: SourceMapLike } | undefined { + const module = analyzeModule({ code, filename: id }) + const { program } = cloneModuleAst(module) + const usedNames = new Set(module.symbols.map((symbol) => symbol.name)) + let counter = 0 + const uniqueName = (prefix: string) => { + let name = prefix + while (usedNames.has(name)) { + name = `${prefix}_${counter++}` + } + usedNames.add(name) + return name + } let modified = false - let mockCounter = 0 - - // Walk program body in reverse so splice indices stay valid - for (let i = ast.program.body.length - 1; i >= 0; i--) { - const node = ast.program.body[i]! - - if (t.isImportDeclaration(node)) { - if (node.importKind === 'type') continue - if (!deniedSources.has(node.source.value)) continue - - const mockVar = `__tss_deny_${mockCounter++}` - const replacements: Array = [] - - replacements.push( - t.importDeclaration( - [t.importDefaultSpecifier(t.identifier(mockVar))], - t.stringLiteral(getMockModuleId(node.source.value)), - ), + for (let i = program.body.length - 1; i >= 0; i--) { + const node = program.body[i]! + if ( + !( + is.ImportDeclaration(node) || + is.ExportNamedDeclaration(node) || + is.ExportAllDeclaration(node) ) - - for (const specifier of node.specifiers) { - if ( - t.isImportDefaultSpecifier(specifier) || - t.isImportNamespaceSpecifier(specifier) - ) { - replacements.push( - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(specifier.local.name), - t.identifier(mockVar), - ), - ]), - ) - } else if (t.isImportSpecifier(specifier)) { - if (specifier.importKind === 'type') continue - const importedName = getModuleExportName(specifier.imported) - const memberProperty = toMemberExpressionProperty(importedName) - replacements.push( - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(specifier.local.name), - t.memberExpression( - t.identifier(mockVar), - memberProperty.property, - memberProperty.computed, - ), - ), - ]), - ) - } - } - - ast.program.body.splice(i, 1, ...replacements) + ) { + continue + } + if (!node.source || !deniedSources.has(node.source.value)) { + continue + } + if ( + (is.ImportDeclaration(node) && node.importKind === 'type') || + (!is.ImportDeclaration(node) && node.exportKind === 'type') + ) { + continue + } + if (is.ExportAllDeclaration(node)) { + program.body.splice(i, 1) modified = true continue } - - if (t.isExportNamedDeclaration(node) && node.source) { - if (node.exportKind === 'type') continue - if (!deniedSources.has(node.source.value)) continue - - const mockIndex = mockCounter++ - const mockVar = `__tss_deny_${mockIndex}` - const replacements: Array = [] - - replacements.push( - t.importDeclaration( - [t.importDefaultSpecifier(t.identifier(mockVar))], - t.stringLiteral(getMockModuleId(node.source.value)), - ), - ) - const usedInternalVars = new Set() - const exportSpecifiers: Array<{ - localName: string - exportedName: string - }> = [] + const mockIndex = counter++ + const mockVar = uniqueName(`__tss_deny_${mockIndex}`) + const statements = [ + `import ${mockVar} from ${JSON.stringify(getMockModuleId(node.source.value))}`, + ] + if (is.ImportDeclaration(node)) { for (const specifier of node.specifiers) { - if (t.isExportSpecifier(specifier)) { - if (specifier.exportKind === 'type') continue - const localName = getModuleExportName(specifier.local) - const exportedName = getModuleExportName(specifier.exported) - const memberProperty = toMemberExpressionProperty(localName) - - const internalVar = createInternalReexportVarName( - localName, - mockIndex, - usedInternalVars, + if (is.ImportSpecifier(specifier)) { + if (specifier.importKind === 'type') { + continue + } + const imported = nameOf(specifier.imported) + statements.push( + `const ${specifier.local.name} = ${memberAccess(mockVar, imported)}`, ) - replacements.push( - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(internalVar), - t.memberExpression( - t.identifier(mockVar), - memberProperty.property, - memberProperty.computed, - ), - ), - ]), - ) - exportSpecifiers.push({ localName: internalVar, exportedName }) + } else { + statements.push(`const ${specifier.local.name} = ${mockVar}`) } } - - if (exportSpecifiers.length > 0) { - replacements.push( - t.exportNamedDeclaration( - null, - exportSpecifiers.map((s) => - t.exportSpecifier( - t.identifier(s.localName), - toModuleExportNameNode(s.exportedName), - ), - ), - ), + } else { + const exportSpecifiers: Array = [] + for (const specifier of node.specifiers) { + if (specifier.exportKind === 'type') { + continue + } + const local = nameOf(specifier.local) + const exported = nameOf(specifier.exported) + const internal = uniqueName( + isValidIdentifier(local) + ? `__tss_reexport_${local}` + : `__tss_reexport_${mockIndex}`, ) + statements.push(`const ${internal} = ${memberAccess(mockVar, local)}`) + exportSpecifiers.push(`${internal} as ${exportName(exported)}`) + } + if (exportSpecifiers.length) { + statements.push(`export { ${exportSpecifiers.join(', ')} }`) } - - ast.program.body.splice(i, 1, ...replacements) - modified = true - continue } - - if (t.isExportAllDeclaration(node)) { - if (node.exportKind === 'type') continue - if (!deniedSources.has(node.source.value)) continue - - ast.program.body.splice(i, 1) - modified = true - continue + const replacements = parseStatements(statements.join('\n')) + for (const statement of replacements) { + statement.start = node.start + statement.end = node.end } + program.body.splice(i, 1, ...replacements) + modified = true } - - if (!modified) return undefined - - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: id, - filename: id, - }) - + if (!modified) { + return undefined + } + const result = generateModule(program, { source: code, filename: id }) return { code: result.code, ...(result.map ? { map: result.map as SourceMapLike } : {}), diff --git a/packages/start-plugin-core/src/import-protection/sourceLocation.ts b/packages/start-plugin-core/src/import-protection/sourceLocation.ts index ee346b327b3..0db8c1f2911 100644 --- a/packages/start-plugin-core/src/import-protection/sourceLocation.ts +++ b/packages/start-plugin-core/src/import-protection/sourceLocation.ts @@ -9,7 +9,7 @@ import { import { getOrCreate, normalizeFilePath } from './utils' import type { ImportAnalysis } from './analysis' import type { Loc } from './trace' -import type { ParseAstResult } from '@tanstack/router-utils' +import type { Module } from 'yuku-analyzer' import type { RawSourceMap } from 'source-map' // Source-map type compatible with both Rollup's SourceMap and source-map's @@ -42,7 +42,7 @@ export interface TransformResult { originalResult?: TransformResult /** Precomputed line index for `code` (index → line/col). */ lineIndex?: LineIndex - parsedAst?: ParseAstResult + analyzedModule?: Module analysis?: ImportAnalysis perf?: ImportProtectionPerfRecorder } diff --git a/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts b/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts index 3cd1725fa09..d66e7b76e23 100644 --- a/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts +++ b/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts @@ -26,7 +26,6 @@ import type { CompileStartFrameworkOptions, StartCompilerImportTransform, StartCompilerPlugin, - StartCompilerTransformResult, } from '../types' import type { DevServerFnModuleSpecifierEncoder, @@ -259,7 +258,7 @@ export function registerStartCompilerTransforms( let nextCode = code let previousResult: { code: string - map: StartCompilerTransformResult['map'] + map: string | null } | null = null const id = ctx.resource const root = getRoot() @@ -275,7 +274,7 @@ export function registerStartCompilerTransforms( nextCode = virtualResult.code previousResult = { code: virtualResult.code, - map: virtualResult.map ?? null, + map: virtualResult.map ? JSON.stringify(virtualResult.map) : null, } } @@ -391,7 +390,7 @@ export function registerStartCompilerTransforms( if (result) { return { code: result.code, - map: result.map ?? null, + map: result.map ? JSON.stringify(result.map) : null, } } diff --git a/packages/start-plugin-core/src/start-compiler/compiler.ts b/packages/start-plugin-core/src/start-compiler/compiler.ts index cbb2978ec07..461f50e9563 100644 --- a/packages/start-plugin-core/src/start-compiler/compiler.ts +++ b/packages/start-plugin-core/src/start-compiler/compiler.ts @@ -1,21 +1,22 @@ import crypto from 'node:crypto' -import * as t from '@babel/types' +import { is, walk } from 'yuku-ast' import { - deadCodeElimination, - extractModuleInfoFromAst, - findReferencedIdentifiers, - generateFromAst, - getVariableDeclaratorForExpressionPath, - parseAst, + analyzeModule, + cloneModuleAst, + extractModuleInfo, + generateModule, + parseExpression, + removeUnusedBindings, unwrapExpression, } from '@tanstack/router-utils' -import babel from '@babel/core' import { handleCreateServerFn } from './handleCreateServerFn' import { handleCreateMiddleware } from './handleCreateMiddleware' import { handleCreateIsomorphicFn } from './handleCreateIsomorphicFn' import { handleEnvOnlyFn } from './handleEnvOnly' import { handleClientOnlyJSX } from './handleClientOnlyJSX' -import { cleanId } from './utils' +import { cleanId, createAstEditor, getVariableDeclarator } from './utils' +import type * as t from '@yuku-toolchain/types' +import type { Module } from 'yuku-analyzer' import type { CompilationContext, DevServerFnModuleSpecifierEncoder, @@ -29,6 +30,7 @@ import type { StartCompilerEnvironment, StartCompilerImportTransform, StartCompilerPlugin, + StartCompilerTransformContext, StartCompilerTransformResult, } from '../types' @@ -39,7 +41,7 @@ type Binding = ModuleInfoBinding & { type ImportBinding = Extract type Kind = 'None' | `Root` | `Builder` | LookupKind -type ParsedAst = ReturnType +type ParsedAst = t.Program type StartCompilerAstPlugin = StartCompilerPlugin & { transformAst: NonNullable } @@ -103,7 +105,9 @@ function isStartCompilerEnvironmentEnabled( | undefined, env: StartCompilerEnvironment, ): boolean { - if (!environment) return true + if (!environment) { + return true + } if (Array.isArray(environment)) { return environment.includes(env) } @@ -244,7 +248,9 @@ export function detectKindsInCode( } for (const transform of opts?.compilerTransforms ?? []) { - if (!isCompilerTransformEnabledForEnv(transform, env)) continue + if (!isCompilerTransformEnabledForEnv(transform, env)) { + continue + } transform.detect.lastIndex = 0 if (transform.detect.test(code)) { detected.add(getExternalLookupKind(transform)) @@ -307,124 +313,6 @@ interface ModuleInfo { reExportAllSources: Array } -/** - * Checks if all kinds in the set are guaranteed to be top-level only. - * Only ServerFn is always declared at module level (must be assigned to a variable). - * Middleware, IsomorphicFn, ServerOnlyFn, ClientOnlyFn can be nested inside functions. - * When all kinds are top-level-only, we can use a fast scan instead of full traversal. - */ -function areAllKindsTopLevelOnly(kinds: Set): boolean { - return kinds.size === 1 && kinds.has('ServerFn') -} - -/** - * Checks if we need to detect JSX elements (e.g., ). - */ -function needsJSXDetection( - kinds: Set, - externalLookupSetup?: Map, -): boolean { - for (const kind of kinds) { - if (getLookupSetup(kind, externalLookupSetup)?.type === 'jsx') { - return true - } - } - return false -} - -/** - * Checks if a CallExpression is a direct-call candidate for NESTED detection. - * Returns true if the callee is a known factory function name. - * This is stricter than top-level detection because we need to filter out - * invocations of existing server functions (e.g., `myServerFn()`). - */ -function isNestedDirectCallCandidate( - node: t.CallExpression, - lookupKinds: Set, - externalLookupSetup?: Map, -): boolean { - let calleeName: string | undefined - if (t.isIdentifier(node.callee)) { - calleeName = node.callee.name - } else if ( - t.isMemberExpression(node.callee) && - t.isIdentifier(node.callee.property) - ) { - calleeName = node.callee.property.name - } - if (!calleeName) return false - for (const kind of lookupKinds) { - if (isExternalLookupKind(kind)) continue - const setup = getLookupSetup(kind, externalLookupSetup) - if (setup?.type === 'directCall' && setup.factoryNames.has(calleeName)) { - return true - } - } - return false -} - -function isSimpleDirectCallExpression(node: t.CallExpression): boolean { - return ( - t.isIdentifier(node.callee) || - (t.isMemberExpression(node.callee) && - t.isIdentifier(node.callee.object) && - t.isIdentifier(node.callee.property)) - ) -} - -function isTopLevelDirectCallCandidateNode(node: t.CallExpression): boolean { - return isSimpleDirectCallExpression(node) -} - -function getPotentialCandidateCallExpression( - node: t.Expression | null | undefined, -): t.CallExpression | null { - if (!node) { - return null - } - - const unwrapped = unwrapExpression(node) - return t.isCallExpression(unwrapped) ? unwrapped : null -} - -/** - * Checks if a CallExpression path is a top-level direct-call candidate. - * Top-level means the call is the init of a VariableDeclarator at program level. - * We accept any simple identifier call or namespace call at top level - * (e.g., `createServerOnlyFn()`, `TanStackStart.createServerOnlyFn()`) and let - * resolution verify it. This handles renamed imports. - */ -function isTopLevelDirectCallCandidate( - path: babel.NodePath, -): boolean { - const node = path.node - - // Must be a simple identifier call or namespace call - if (!isSimpleDirectCallExpression(node)) { - return false - } - - // Must be top-level: VariableDeclarator -> VariableDeclaration -> Program - // or VariableDeclarator -> VariableDeclaration -> ExportNamedDeclaration -> Program. - const variableDeclarator = getVariableDeclaratorForExpressionPath( - path as babel.NodePath, - ) - if (!variableDeclarator) { - return false - } - - const variableDeclaration = variableDeclarator.parentPath - if (!variableDeclaration.isVariableDeclaration()) { - return false - } - - const parent = variableDeclaration.parentPath - return ( - parent.isProgram() || - (parent.isExportNamedDeclaration() && parent.parentPath.isProgram()) - ) -} - function isDirectCallCandidateForKind( kind: Exclude, externalLookupSetup?: Map, @@ -432,69 +320,6 @@ function isDirectCallCandidateForKind( return getLookupSetup(kind, externalLookupSetup)?.type === 'directCall' } -function hasBuiltInDirectCallKinds(kinds: Set): boolean { - for (const kind of kinds) { - if (isExternalLookupKind(kind)) continue - if (BuiltInLookupSetup[kind].type === 'directCall') return true - } - return false -} - -function hasExternalLookupKinds(kinds: Set): boolean { - for (const kind of kinds) { - if (isExternalLookupKind(kind)) return true - } - return false -} - -interface ExternalDirectCallCandidates { - identifiers: Map - namespaces: Map> -} - -interface CallExpressionCandidate { - path: babel.NodePath - /** Set when import scanning already proved the call's lookup kind. */ - kind?: Exclude -} - -function hasExternalDirectCallCandidates( - candidates: ExternalDirectCallCandidates, -): boolean { - return candidates.identifiers.size > 0 || candidates.namespaces.size > 0 -} - -function getExternalDirectCallCandidateKind( - path: babel.NodePath, - candidates: ExternalDirectCallCandidates, -): ExternalLookupKind | undefined { - const node = path.node - - if (t.isIdentifier(node.callee)) { - const kind = candidates.identifiers.get(node.callee.name) - if (!kind) return undefined - - const binding = path.scope.getBinding(node.callee.name) - return binding?.path.isImportSpecifier() ? kind : undefined - } - - if ( - t.isMemberExpression(node.callee) && - t.isIdentifier(node.callee.object) && - t.isIdentifier(node.callee.property) - ) { - const kind = candidates.namespaces - .get(node.callee.object.name) - ?.get(node.callee.property.name) - if (!kind) return undefined - - const binding = path.scope.getBinding(node.callee.object.name) - return binding?.path.isImportNamespaceSpecifier() ? kind : undefined - } - - return undefined -} - export class StartCompiler { private moduleCache = new Map() private initialized = false @@ -505,10 +330,6 @@ export class StartCompiler { >() private externalLookupSetup = new Map() private compilerPlugins: Array - private externalDirectCallKindsBySource = new Map< - string, - Map - >() private resolveIdCache = new Map() private exportResolutionCache = new Map< string, @@ -576,22 +397,15 @@ export class StartCompiler { for (const transform of options.compilerTransforms ?? []) { const kind = getExternalLookupKind(transform) - if (!this.validLookupKinds.has(kind)) continue + if (!this.validLookupKinds.has(kind)) { + continue + } this.externalTransformsByKind.set(kind, transform) const factoryNames = new Set() for (const entry of transform.imports) { factoryNames.add(entry.rootExport) - - let rootExports = this.externalDirectCallKindsBySource.get( - entry.libName, - ) - if (!rootExports) { - rootExports = new Map() - this.externalDirectCallKindsBySource.set(entry.libName, rootExports) - } - rootExports.set(entry.rootExport, kind) } this.externalLookupSetup.set(kind, { @@ -676,46 +490,6 @@ export class StartCompiler { return this.options.mode ?? 'dev' } - private getExternalDirectCallCandidates( - kinds: Set, - moduleInfo: ModuleInfo, - ): ExternalDirectCallCandidates { - const identifiers = new Map() - const namespaces = new Map>() - - if (this.externalDirectCallKindsBySource.size === 0) { - return { identifiers, namespaces } - } - - for (const [localName, binding] of moduleInfo.bindings) { - if (binding.type !== 'import') continue - - const rootExports = this.externalDirectCallKindsBySource.get( - binding.source, - ) - if (!rootExports) continue - - if (binding.importedName === '*') { - const namespaceExports = new Map() - for (const [rootExport, kind] of rootExports) { - if (kinds.has(kind)) { - namespaceExports.set(rootExport, kind) - } - } - if (namespaceExports.size > 0) { - namespaces.set(localName, namespaceExports) - } - } else { - const kind = rootExports.get(binding.importedName) - if (kind && kinds.has(kind)) { - identifiers.set(localName, kind) - } - } - } - - return { identifiers, namespaces } - } - private async resolveIdCached(id: string, importer?: string) { if (this.mode === 'dev') { return this.options.resolveId(id, importer) @@ -818,11 +592,8 @@ export class StartCompiler { /** * Extracts bindings and exports from an already-parsed AST. */ - private extractModuleInfo( - ast: ReturnType, - id: string, - ): ModuleInfo { - const extracted = extractModuleInfoFromAst(ast) + private extractModuleInfo(module: Module, id: string): ModuleInfo { + const extracted = extractModuleInfo(module) const info: ModuleInfo = { id, @@ -843,9 +614,12 @@ export class StartCompiler { id: string parserFilename?: string }) { - const ast = parseAst({ code, filename: parserFilename ?? cleanId(id) }) - const info = this.extractModuleInfo(ast, id) - return { info, ast } + const module = analyzeModule({ + code, + filename: parserFilename ?? cleanId(id), + }) + const info = this.extractModuleInfo(module, id) + return { info, module } } public invalidateModule(id: string) { @@ -937,10 +711,14 @@ export class StartCompiler { await Promise.all( Array.from(importSources, async (source) => { const resolved = await resolveSource(source, moduleInfo.id) - if (!resolved) return + if (!resolved) { + return + } const targetId = cleanId(resolved) - if (targetId === moduleId) return + if (targetId === moduleId) { + return + } let importers = importersByTarget.get(targetId) if (!importers) { @@ -993,438 +771,247 @@ export class StartCompiler { await this.init() } - // Use detected kinds if provided, otherwise fall back to all valid kinds for this env const fileKinds = detectedKinds - ? new Set([...detectedKinds].filter((k) => this.validLookupKinds.has(k))) + ? new Set( + [...detectedKinds].filter((kind) => this.validLookupKinds.has(kind)), + ) : this.validLookupKinds - - const astTransformPlugins = this.getAstTransformPluginsForCode(code) - // Always parse and extract module info upfront. - // This ensures the module is cached for import resolution even if no candidates are found. - const ast = this.ingestModule({ code, id, parserFilename }).ast - const warnFn = warn ?? this.options.warn - let astHasChanges = false - - builtInTransforms: { - // Early exit if no built-in or import transforms need this file. - if (fileKinds.size === 0) { - break builtInTransforms + const candidateKinds = new Set(fileKinds) + if ( + fileKinds.has('ServerFn') && + ![...fileKinds].some(isExternalLookupKind) + ) { + for (const kind of this.validLookupKinds) { + if ( + !isExternalLookupKind(kind) && + getLookupSetup(kind)?.type === 'directCall' + ) { + candidateKinds.add(kind) + } } - - const hasExternalKinds = hasExternalLookupKinds(fileKinds) - const checkDirectCalls = - hasBuiltInDirectCallKinds(fileKinds) || - (fileKinds.has('ServerFn') && - !hasExternalKinds && - hasBuiltInDirectCallKinds(this.validLookupKinds)) - // Optimization: ServerFn is always a top-level declaration (must be assigned to a variable). - // If the file only has ServerFn, we can skip full AST traversal and only visit - // the specific top-level declarations that have candidates. - const canUseFastPath = areAllKindsTopLevelOnly(fileKinds) - - // Single-pass traversal to: - // 1. Collect candidate paths (only candidates, not all CallExpressions) - // 2. Build a map for looking up paths of nested calls in method chains - const candidatePaths: Array = [] - // Map for nested chain lookup - only populated for CallExpressions that are - // part of a method chain (callee.object is a CallExpression) - const chainCallPaths = new Map< - t.CallExpression, - babel.NodePath - >() - - // JSX candidates (e.g., ) - const jsxCandidatePaths: Array> = [] - const checkJSX = needsJSXDetection(fileKinds, this.externalLookupSetup) - // Get module info that was just cached by ingestModule - const moduleInfo = this.moduleCache.get(id)! - const externalDirectCallCandidates = this.getExternalDirectCallCandidates( - fileKinds, - moduleInfo, - ) - const checkExternalDirectCalls = hasExternalDirectCallCandidates( - externalDirectCallCandidates, - ) - - if (canUseFastPath) { - // Fast path: only visit top-level statements that have potential candidates - - // Collect indices of top-level statements that contain candidates - const candidateIndices: Array = [] - for (let i = 0; i < ast.program.body.length; i++) { - const node = ast.program.body[i]! - let declarations: Array | undefined - - if (t.isVariableDeclaration(node)) { - declarations = node.declarations - } else if (t.isExportNamedDeclaration(node) && node.declaration) { - if (t.isVariableDeclaration(node.declaration)) { - declarations = node.declaration.declarations - } - } - - if (declarations) { - for (const decl of declarations) { - const init = getPotentialCandidateCallExpression(decl.init) - if (init) { - if ( - isMethodChainCandidate(init, fileKinds) || - (checkDirectCalls && isTopLevelDirectCallCandidateNode(init)) - ) { - candidateIndices.push(i) - break // Only need to mark this statement once - } - } - } - } + } + const { module } = this.ingestModule({ code, id, parserFilename }) + const { program: ast, originalNodes } = cloneModuleAst(module) + const editor = createAstEditor(ast) + const context: CompilationContext = { + ast, + module, + originalNodes, + ...editor, + code, + id, + env: this.options.env, + envName: this.options.envName, + mode: this.mode, + root: this.options.root, + framework: this.options.framework, + providerEnvName: this.options.providerEnvName, + parseExpression, + warn: warn ?? this.options.warn, + generateFunctionId: (options) => this.generateFunctionId(options), + getKnownServerFns: this.options.getKnownServerFns, + serverFnProviderModuleDirectives: + this.options.serverFnProviderModuleDirectives, + onServerFnsById: this.options.onServerFnsById, + } + const calls: Array = [] + const jsx: Array = [] + const sourceInfo = this.moduleCache.get(id)! + walk(ast, { + CallExpression: (node, position) => { + if ( + is.MemberExpression(position.parent) && + is.CallExpression(editor.parentOf(position.parent)) + ) { + return } - - // Early exit: no potential candidates found at top level - if (candidateIndices.length === 0) { - break builtInTransforms + if (isMethodChainCandidate(node, fileKinds)) { + calls.push(node) + return } - - // Targeted traversal: only visit the specific statements that have candidates - // This is much faster than traversing the entire AST - babel.traverse(ast, { - Program(programPath) { - const bodyPaths = programPath.get('body') - for (const idx of candidateIndices) { - const stmtPath = bodyPaths[idx] - if (!stmtPath) continue - - // Traverse only this statement's subtree - stmtPath.traverse({ - CallExpression(path) { - const node = path.node - const parent = path.parent - - // Check if this call is part of a larger chain (inner call) - if ( - t.isMemberExpression(parent) && - t.isCallExpression(path.parentPath.parent) - ) { - chainCallPaths.set(node, path) - return - } - - // Method chain pattern - if (isMethodChainCandidate(node, fileKinds)) { - candidatePaths.push({ path }) - return - } - - if (checkExternalDirectCalls) { - const kind = getExternalDirectCallCandidateKind( - path, - externalDirectCallCandidates, - ) - if (kind) { - candidatePaths.push({ path, kind }) - return - } - } - - if (isTopLevelDirectCallCandidate(path)) { - candidatePaths.push({ path }) - } - }, - }) - } - // Stop traversal after processing Program - programPath.stop() - }, - }) - } else { - // Normal path: full traversal for non-fast-path kinds - babel.traverse(ast, { - CallExpression: (path) => { - const node = path.node - const parent = path.parent - - // Check if this call is part of a larger chain (inner call) - // If so, store it for method chain lookup but don't treat as candidate + const callee = is.Expression(node.callee) + ? unwrapExpression(node.callee) + : node.callee + const name = is.Identifier(callee) + ? callee.name + : is.MemberExpression(callee) && is.Identifier(callee.property) + ? callee.property.name + : null + if (!name) { + return + } + const receiver = + is.MemberExpression(callee) && is.Expression(callee.object) + ? unwrapExpression(callee.object) + : null + const simpleDirectCall = + is.Identifier(callee) || is.Identifier(receiver) + const declarator = getVariableDeclarator(node, editor.parentOf) + const declaration = declarator && editor.parentOf(declarator) + const parent = declaration && editor.parentOf(declaration) + const topLevel = + is.Program(parent) || + (is.ExportNamedDeclaration(parent) && + is.Program(editor.parentOf(parent))) + for (const kind of candidateKinds) { + const setup = getLookupSetup(kind, this.externalLookupSetup) + if (setup?.type !== 'directCall') { + continue + } + if ((topLevel && simpleDirectCall) || setup.factoryNames.has(name)) { + calls.push(node) + return + } + if (isExternalLookupKind(kind)) { + const root = is.Identifier(callee) + ? callee + : is.Identifier(receiver) + ? receiver + : null + const symbol = root && module.symbolOf(originalNodes.get(root)!) + const binding = symbol && sourceInfo.bindings.get(symbol.name) if ( - t.isMemberExpression(parent) && - t.isCallExpression(path.parentPath.parent) + binding?.type === 'import' && + symbol?.scope === module.rootScope && + this.knownRootImports + .get(binding.source) + ?.get( + binding.importedName === '*' ? name : binding.importedName, + ) === kind ) { - // This is an inner call in a chain - store for later lookup - chainCallPaths.set(node, path) + calls.push(node) return } - - // Pattern 1: Method chain pattern (.handler(), .server(), .client(), etc.) - if (isMethodChainCandidate(node, fileKinds)) { - candidatePaths.push({ path }) - return - } - - // External direct-call transforms are import-bound. Direct imports - // already identify the transform kind, so skip async import tracing. - if (checkExternalDirectCalls) { - const kind = getExternalDirectCallCandidateKind( - path, - externalDirectCallCandidates, - ) - if (kind) { - candidatePaths.push({ path, kind }) - return - } - } - - if (checkDirectCalls && isTopLevelDirectCallCandidate(path)) { - candidatePaths.push({ path }) - return - } - - // Pattern 2: Direct call pattern - if (checkDirectCalls) { - if ( - isNestedDirectCallCandidate( - node, - fileKinds, - this.externalLookupSetup, - ) - ) { - candidatePaths.push({ path }) - return - } - } - }, - // Pattern 3: JSX element pattern (e.g., ) - // Collect JSX elements where the component is imported from a known package - // and resolves to a JSX kind (e.g., ClientOnly from @tanstack/react-router) - JSXElement: (path) => { - if (!checkJSX) return - - const openingElement = path.node.openingElement - const nameNode = openingElement.name - - // Only handle simple identifier names (not namespaced or member expressions) - if (!t.isJSXIdentifier(nameNode)) return - - const componentName = nameNode.name - const binding = moduleInfo.bindings.get(componentName) - - // Must be an import binding from a known package - if (!binding || binding.type !== 'import') return - - // Verify the import source is a known TanStack router package - const knownExports = this.knownRootImports.get(binding.source) - if (!knownExports) return - - // Verify the imported name resolves to a JSX kind (e.g., ClientOnlyJSX) - const kind = knownExports.get(binding.importedName) - if (kind !== 'ClientOnlyJSX') return - - jsxCandidatePaths.push(path) - }, - }) - } - - if (candidatePaths.length === 0 && jsxCandidatePaths.length === 0) { - break builtInTransforms - } - - // Resolve only candidates whose import scan did not already prove the kind. - const resolvedCandidates: Array<{ - path: babel.NodePath - kind: Kind - }> = [] - const unresolvedCandidates: Array = [] - - for (const candidate of candidatePaths) { - if (candidate.kind) { - resolvedCandidates.push({ - path: candidate.path, - kind: candidate.kind, - }) - } else { - unresolvedCandidates.push(candidate) + } } - } - - if (unresolvedCandidates.length > 0) { - resolvedCandidates.push( - ...(await Promise.all( - unresolvedCandidates.map(async (candidate) => ({ - path: candidate.path, - kind: await this.resolveExprKind(candidate.path.node, id), - })), - )), - ) - } - - // Filter to valid candidates - const validCandidates = resolvedCandidates.filter(({ path, kind }) => { + }, + JSXElement: (node) => { if ( - !this.validLookupKinds.has( - kind as Exclude, - ) + !fileKinds.has('ClientOnlyJSX') || + !is.JSXIdentifier(node.openingElement.name) ) { - return false + return } - + const original = originalNodes.get(node.openingElement.name)! + const symbol = module.symbolOf(original) + if (!symbol || symbol.scope !== module.rootScope) { + return + } + const binding = sourceInfo.bindings.get(symbol.name) if ( - isLookupKind(kind) && - kind !== 'ClientOnlyJSX' && - !isMethodChainCandidate(path.node, fileKinds) + binding?.type === 'import' && + this.knownRootImports + .get(binding.source) + ?.get(binding.importedName) === 'ClientOnlyJSX' ) { - return isDirectCallCandidateForKind(kind, this.externalLookupSetup) + jsx.push(node) } - - return true - }) as Array<{ - path: babel.NodePath - kind: Exclude - }> - - if (validCandidates.length === 0 && jsxCandidatePaths.length === 0) { - break builtInTransforms - } - - // Process valid candidates to collect method chains - const pathsToRewrite: Array<{ - path: babel.NodePath - kind: Exclude - methodChain: MethodChainPaths - }> = [] - - for (const { path, kind } of validCandidates) { - const node = path.node - - // Collect method chain paths by walking DOWN from root through the chain - const methodChain: MethodChainPaths = { - middleware: null, - validator: null, - // TODO remove upon stable - inputValidator: null, - handler: null, - server: null, - client: null, - } - - // Walk down the call chain using nodes, look up paths from map - let currentNode: t.CallExpression = node - let currentPath: babel.NodePath = path - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - while (true) { - const callee = currentNode.callee - if (!t.isMemberExpression(callee)) { - break - } - - // Record method chain path if it's a known method - if (t.isIdentifier(callee.property)) { - const name = callee.property.name as keyof MethodChainPaths - if (name in methodChain) { - // Get first argument path - const args = currentPath.get('arguments') - const firstArgPath = - Array.isArray(args) && args.length > 0 - ? (args[0] ?? null) - : null - methodChain[name] = { - callPath: currentPath, - firstArgPath, - } - } + }, + }) + const candidatesByKind = new Map< + Exclude, + Array + >() + const resolved = await Promise.all( + calls.map(async (node) => { + // Only module bindings can participate in the cross-module builder graph. + // Local shadowing is decided by Yuku's resolved references before tracing. + let base: t.Node = node + for (;;) { + if (is.Expression(base)) { + base = unwrapExpression(base) } - - // Move to the inner call (the object of the member expression) - if (!t.isCallExpression(callee.object)) { + if (is.CallExpression(base)) { + base = base.callee + } else if (is.MemberExpression(base)) { + base = base.object + } else { break } - currentNode = callee.object - // Look up path from chain map, or use candidate path if not found - const nextPath = chainCallPaths.get(currentNode) - if (!nextPath) { - break + } + if (is.Identifier(base)) { + const symbol = module.symbolOf(originalNodes.get(base)!) + if (!symbol || symbol.scope !== module.rootScope) { + return { node, kind: 'None' as Kind } } - currentPath = nextPath } - - pathsToRewrite.push({ path, kind, methodChain }) + return { node, kind: await this.resolveExprKind(node, id) } + }), + ) + for (const { node, kind } of resolved) { + if ( + !isLookupKind(kind) || + kind === 'ClientOnlyJSX' || + !candidateKinds.has(kind) + ) { + continue } - - const refIdents = findReferencedIdentifiers(ast) - - const context: CompilationContext = { - ast, - id, - code, - env: this.options.env, - envName: this.options.envName, - mode: this.mode, - root: this.options.root, - framework: this.options.framework, - providerEnvName: this.options.providerEnvName, - types: t, - parseExpression: (expressionCode) => - babel.template.expression(expressionCode, { - placeholderPattern: false, - })(), - warn: warnFn, - - generateFunctionId: (opts) => this.generateFunctionId(opts), - getKnownServerFns: this.options.getKnownServerFns, - serverFnProviderModuleDirectives: - this.options.serverFnProviderModuleDirectives, - onServerFnsById: this.options.onServerFnsById, + if ( + !isMethodChainCandidate(node, fileKinds) && + !isDirectCallCandidateForKind(kind, this.externalLookupSetup) + ) { + continue } - - // Group candidates by kind for batch processing - const candidatesByKind = new Map< - Exclude, - Array - >() - - for (const { path: candidatePath, kind, methodChain } of pathsToRewrite) { - const candidate: RewriteCandidate = { path: candidatePath, methodChain } - const existing = candidatesByKind.get(kind) - if (existing) { - existing.push(candidate) - } else { - candidatesByKind.set(kind, [candidate]) + const methodChain: MethodChainPaths = { + middleware: null, + validator: null, + inputValidator: null, + handler: null, + server: null, + client: null, + } + let current = node + for (;;) { + const callee = is.Expression(current.callee) + ? unwrapExpression(current.callee) + : current.callee + if (!is.MemberExpression(callee)) { + break + } + if ( + is.Identifier(callee.property) && + callee.property.name in methodChain + ) { + methodChain[callee.property.name as keyof MethodChainPaths] = { + call: current, + firstArg: current.arguments[0] ?? null, + } } + const object = is.Expression(callee.object) + ? unwrapExpression(callee.object) + : callee.object + if (!is.CallExpression(object)) { + break + } + current = object } - - // External transforms run before built-ins by default so they can augment - // user handlers before server function extraction clones provider bodies. + const candidates = candidatesByKind.get(kind) ?? [] + candidates.push({ node, methodChain }) + candidatesByKind.set(kind, candidates) + } + let modified = candidatesByKind.size > 0 || jsx.length > 0 + if (modified) { this.runExternalTransforms('pre', candidatesByKind, context) - for (const kind of BuiltInKindHandlerOrder) { const candidates = candidatesByKind.get(kind) - if (!candidates) continue - const handler = BuiltInKindHandlers[kind] - handler(candidates, context, kind) + if (candidates) { + BuiltInKindHandlers[kind](candidates, context, kind) + } } - this.runExternalTransforms('post', candidatesByKind, context) - - // Handle JSX candidates (e.g., ) - // Validation was already done during traversal - just call the handler - for (const jsxPath of jsxCandidatePaths) { - handleClientOnlyJSX(jsxPath, { env: 'server' }) + for (const element of jsx) { + handleClientOnlyJSX(element, { env: 'server' }) } - - deadCodeElimination(ast, refIdents) - astHasChanges = true - } - - if (astTransformPlugins.length > 0) { - astHasChanges = - this.runAstTransforms({ - ast, - code, - id, - transforms: astTransformPlugins, - warn: warnFn, - }) || astHasChanges + removeUnusedBindings(module, ast, originalNodes, { + preserveInitiallyUnused: true, + }) } - - return astHasChanges ? this.generateResultFromAst(ast, code, id) : null + modified = + this.runAstTransforms( + context, + this.getAstTransformPluginsForCode(code), + ) || modified + return modified ? this.generateResultFromAst(ast, code, id) : null } private generateResultFromAst( @@ -1432,21 +1019,7 @@ export class StartCompiler { sourceCode: string, id: string, ): StartCompilerTransformResult { - const result = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: id, - filename: id, - }) - - // @babel/generator does not populate sourcesContent because it only has - // the AST, not the original text. Without this, Vite's composed sourcemap - // omits the original source, causing downstream consumers to fall back to - // the compiled output and fail to resolve original line numbers. - if (result.map) { - result.map.sourcesContent = [sourceCode] - } - - return result + return generateModule(ast, { source: sourceCode, filename: id }) } private getAstTransformPluginsForCode( @@ -1454,51 +1027,26 @@ export class StartCompiler { ): Array { return this.compilerPlugins.filter( (plugin): plugin is StartCompilerAstPlugin => { - if (!plugin.transformAst) return false - if (!plugin.detect) return true + if (!plugin.transformAst) { + return false + } + if (!plugin.detect) { + return true + } plugin.detect.lastIndex = 0 return plugin.detect.test(code) }, ) } - private runAstTransforms({ - ast, - code, - id, - transforms, - warn, - }: { - ast: ParsedAst - code: string - id: string - transforms: Array - warn?: (message: string) => void - }): boolean { + private runAstTransforms( + context: StartCompilerTransformContext, + transforms: Array, + ): boolean { let modified = false - for (const plugin of transforms) { - const context = { - ast, - code, - id, - env: this.options.env, - envName: this.options.envName, - mode: this.mode, - root: this.options.root, - framework: this.options.framework, - providerEnvName: this.options.providerEnvName, - types: t, - parseExpression: (expressionCode: string) => - babel.template.expression(expressionCode, { - placeholderPattern: false, - })(), - warn, - } - modified = plugin.transformAst(context) || modified } - return modified } @@ -1511,10 +1059,14 @@ export class StartCompiler { context: CompilationContext, ) { for (const [kind, transform] of this.externalTransformsByKind) { - if ((transform.order ?? 'pre') !== order) continue + if ((transform.order ?? 'pre') !== order) { + continue + } const candidates = candidatesByKind.get(kind) - if (!candidates) continue + if (!candidates) { + continue + } transform.transform(candidates, context) } @@ -1807,7 +1359,7 @@ export class StartCompiler { getLookupSetup(resolvedKind, this.externalLookupSetup)?.type === 'directCall' && binding.init && - t.isCallExpression(unwrapExpression(binding.init)) + is.CallExpression(unwrapExpression(binding.init)) ) { binding.resolvedKind = 'None' return 'None' @@ -1817,11 +1369,11 @@ export class StartCompiler { } private async resolveExprKind( - expr: t.Expression | null, + expr: t.Expression | t.Super | null, fileId: string, visited = new Set(), ): Promise { - if (!expr) { + if (!expr || is.Super(expr)) { return 'None' } @@ -1829,21 +1381,18 @@ export class StartCompiler { let result: Kind = 'None' - if (t.isCallExpression(expr)) { - if (!t.isExpression(expr.callee)) { + if (is.CallExpression(expr)) { + if (!is.Expression(expr.callee)) { return 'None' } - const calleeKind = await this.resolveCalleeKind( - expr.callee, - fileId, - visited, - ) + const callee = unwrapExpression(expr.callee) + const calleeKind = await this.resolveCalleeKind(callee, fileId, visited) if (calleeKind === 'Root' || calleeKind === 'Builder') { return 'Builder' } // For method chain patterns (callee is MemberExpression like .server() or .client()), // return the resolved kind if valid - if (t.isMemberExpression(expr.callee)) { + if (is.MemberExpression(callee)) { if (this.validLookupKinds.has(calleeKind as LookupKind)) { return calleeKind } @@ -1854,16 +1403,16 @@ export class StartCompiler { // @tanstack/start-fn-stubs (via fast path or slow path through re-exports). // This handles both direct imports from @tanstack/react-start and imports // from intermediate packages that re-export from @tanstack/start-client-core. - if (t.isIdentifier(expr.callee)) { + if (is.Identifier(callee)) { if (this.validLookupKinds.has(calleeKind as LookupKind)) { return calleeKind } } - } else if (t.isMemberExpression(expr) && t.isIdentifier(expr.property)) { + } else if (is.MemberExpression(expr) && is.Identifier(expr.property)) { result = await this.resolveCalleeKind(expr.object, fileId, visited) } - if (result === 'None' && t.isIdentifier(expr)) { + if (result === 'None' && is.Identifier(expr)) { result = await this.resolveIdentifierKind(expr.name, fileId, visited) } @@ -1871,15 +1420,18 @@ export class StartCompiler { } private async resolveCalleeKind( - callee: t.Expression, + callee: t.Expression | t.Super, fileId: string, visited = new Set(), ): Promise { - if (t.isIdentifier(callee)) { + if (is.Expression(callee)) { + callee = unwrapExpression(callee) + } + if (is.Identifier(callee)) { return this.resolveIdentifierKind(callee.name, fileId, visited) } - if (t.isMemberExpression(callee) && t.isIdentifier(callee.property)) { + if (is.MemberExpression(callee) && is.Identifier(callee.property)) { const prop = callee.property.name // Check if this property matches any method chain pattern @@ -1890,7 +1442,9 @@ export class StartCompiler { // Check each possible kind that uses this identifier for (const kind of possibleKinds) { - if (!this.validLookupKinds.has(kind)) continue + if (!this.validLookupKinds.has(kind)) { + continue + } if (kind === 'ServerFn') { if (base === 'Root' || base === 'Builder') { @@ -1917,9 +1471,12 @@ export class StartCompiler { } // Check if the object is a namespace import - if (t.isIdentifier(callee.object)) { + const receiver = is.Expression(callee.object) + ? unwrapExpression(callee.object) + : callee.object + if (is.Identifier(receiver)) { const info = await this.getModuleInfo(fileId) - const binding = info.bindings.get(callee.object.name) + const binding = info.bindings.get(receiver.name) if ( binding && binding.type === 'import' && @@ -1967,8 +1524,10 @@ function isMethodChainCandidate( node: t.CallExpression, lookupKinds: Set, ): boolean { - const callee = node.callee - if (!t.isMemberExpression(callee) || !t.isIdentifier(callee.property)) { + const callee = is.Expression(node.callee) + ? unwrapExpression(node.callee) + : node.callee + if (!is.MemberExpression(callee) || !is.Identifier(callee.property)) { return false } diff --git a/packages/start-plugin-core/src/start-compiler/handleClientOnlyJSX.ts b/packages/start-plugin-core/src/start-compiler/handleClientOnlyJSX.ts index 9676e4b7bd2..c98d9c614d4 100644 --- a/packages/start-plugin-core/src/start-compiler/handleClientOnlyJSX.ts +++ b/packages/start-plugin-core/src/start-compiler/handleClientOnlyJSX.ts @@ -1,5 +1,4 @@ -import type * as t from '@babel/types' -import type * as babel from '@babel/core' +import type { JSXElement } from '@yuku-toolchain/types' /** * Handles JSX elements on the server side. @@ -18,11 +17,9 @@ import type * as babel from '@babel/core' * */ export function handleClientOnlyJSX( - path: babel.NodePath, + element: JSXElement, _opts: { env: 'server' }, ): void { - const element = path.node - // Remove all children - they are client-only code element.children = [] diff --git a/packages/start-plugin-core/src/start-compiler/handleCreateIsomorphicFn.ts b/packages/start-plugin-core/src/start-compiler/handleCreateIsomorphicFn.ts index 8331a008491..e9da1667eaf 100644 --- a/packages/start-plugin-core/src/start-compiler/handleCreateIsomorphicFn.ts +++ b/packages/start-plugin-core/src/start-compiler/handleCreateIsomorphicFn.ts @@ -1,38 +1,23 @@ -import * as t from '@babel/types' +import { is } from 'yuku-ast' +import { parseExpression } from '@tanstack/router-utils' import type { CompilationContext, RewriteCandidate } from './types' -/** - * Handles createIsomorphicFn transformations for a batch of candidates. - * - * @param candidates - All IsomorphicFn candidates to process - * @param context - The compilation context - */ export function handleCreateIsomorphicFn( candidates: Array, context: CompilationContext, ): void { - for (const candidate of candidates) { - const { path, methodChain } = candidate - - // Get the environment-specific call (.client() or .server()) - const envCallInfo = + for (const { node, methodChain } of candidates) { + const selected = context.env === 'client' ? methodChain.client : methodChain.server - - if (!envCallInfo) { - // No implementation for this environment - replace with no-op - path.replaceWith(t.arrowFunctionExpression([], t.blockStatement([]))) + if (!selected) { + context.replaceNode(node, parseExpression('() => {}')) continue } - - // Extract the function argument from the environment-specific call - const innerFn = envCallInfo.firstArgPath?.node - - if (!t.isExpression(innerFn)) { + if (!is.Expression(selected.firstArg)) { throw new Error( `createIsomorphicFn().${context.env}(func) must be called with a function!`, ) } - - path.replaceWith(innerFn) + context.replaceNode(node, selected.firstArg) } } diff --git a/packages/start-plugin-core/src/start-compiler/handleCreateMiddleware.ts b/packages/start-plugin-core/src/start-compiler/handleCreateMiddleware.ts index 5a378039541..ce140ffe528 100644 --- a/packages/start-plugin-core/src/start-compiler/handleCreateMiddleware.ts +++ b/packages/start-plugin-core/src/start-compiler/handleCreateMiddleware.ts @@ -1,4 +1,4 @@ -import { stripMethodCall } from './utils' +import { sourcePosition, stripMethodCall } from './utils' import type { CompilationContext, MethodCallInfo, @@ -10,10 +10,8 @@ function warnInputValidatorDeprecation( context: CompilationContext, inputValidator: MethodCallInfo, ): void { - const loc = inputValidator.callPath.node.loc?.start - const location = loc - ? `${context.id}:${loc.line}:${loc.column + 1} ` - : `${context.id} ` + const loc = sourcePosition(context.code, inputValidator.call.start) + const location = `${context.id}:${loc.line}:${loc.column + 1} ` context.warn?.( `${location}createMiddleware().inputValidator() is deprecated. Use createMiddleware().validator() instead.`, @@ -51,7 +49,7 @@ export function handleCreateMiddleware( continue } - const innerInputExpression = methodCall.callPath.node.arguments[0] + const innerInputExpression = methodCall.call.arguments[0] if (!innerInputExpression) { throw new Error( @@ -60,12 +58,12 @@ export function handleCreateMiddleware( } // remove the validator call expression - stripMethodCall(methodCall.callPath) + stripMethodCall(methodCall.call, context) } if (server) { // remove the server call expression - stripMethodCall(server.callPath) + stripMethodCall(server.call, context) } } } diff --git a/packages/start-plugin-core/src/start-compiler/handleCreateServerFn.ts b/packages/start-plugin-core/src/start-compiler/handleCreateServerFn.ts index 3d4a8a25425..77729fbb86b 100644 --- a/packages/start-plugin-core/src/start-compiler/handleCreateServerFn.ts +++ b/packages/start-plugin-core/src/start-compiler/handleCreateServerFn.ts @@ -1,213 +1,18 @@ -import * as t from '@babel/types' -import babel from '@babel/core' -import { hasKeys } from '@tanstack/router-core' -import { getVariableDeclaratorForExpressionPath } from '@tanstack/router-utils' +import { b, is } from 'yuku-ast' +import { parseExpression, parseStatements } from '@tanstack/router-utils' import path from 'pathe' -import { cleanId, codeFrameError, stripMethodCall } from './utils' -import type { - CompilationContext, - MethodCallInfo, - RewriteCandidate, - ServerFn, -} from './types' -import type { CompileStartFrameworkOptions } from '../types' +import { + cleanId, + codeFrameError, + getVariableDeclarator, + sourcePosition, + stripMethodCall, +} from './utils' +import type { Program, ProgramStatement } from '@yuku-toolchain/types' +import type { CompilationContext, RewriteCandidate, ServerFn } from './types' const TSS_SERVERFN_SPLIT_PARAM = 'tss-serverfn-split' -const providerHmrAcceptTemplate = babel.template.statements( - ` -if (import.meta.hot) { - import.meta.hot.accept(() => {}) -} -if (import.meta.webpackHot) { - import.meta.webpackHot.accept(() => {}) -} -`, - { - placeholderPattern: false, - }, -) - -// ============================================================================ -// Pre-compiled babel templates (compiled once at module load time) -// ============================================================================ - -// Template for provider files: createServerRpc(serverFnMeta, fn) -const serverRpcTemplate = babel.template.expression( - `createServerRpc(%%serverFnMeta%%, %%fn%%)`, -) - -// Template for client caller files: createClientRpc(functionId) -const clientRpcTemplate = babel.template.expression( - `createClientRpc(%%functionId%%)`, -) - -// Template for SSR caller files: createSsrRpc(functionId) -const ssrRpcManifestTemplate = babel.template.expression( - `createSsrRpc(%%functionId%%)`, -) - -// TODO remove upon stable -function warnInputValidatorDeprecation( - context: CompilationContext, - inputValidator: MethodCallInfo, -): void { - const loc = inputValidator.callPath.node.loc?.start - const location = loc - ? `${context.id}:${loc.line}:${loc.column + 1} ` - : `${context.id} ` - - context.warn?.( - `${location}createServerFn().inputValidator() is deprecated. Use createServerFn().validator() instead.`, - ) -} - -// ============================================================================ -// Runtime code cache (cached per framework to avoid repeated AST generation) -// ============================================================================ - -type RuntimeCodeType = 'provider' | 'client' | 'ssr' -type FrameworkRuntimeCache = Record -const RuntimeCodeCache = new Map< - CompileStartFrameworkOptions, - FrameworkRuntimeCache ->() - -function getCachedRuntimeCode( - framework: CompileStartFrameworkOptions, - type: RuntimeCodeType, -): t.Statement { - let cache = RuntimeCodeCache.get(framework) - if (!cache) { - cache = { - provider: babel.template.ast( - `import { createServerRpc } from '@tanstack/${framework}-start/server-rpc'`, - { placeholderPattern: false }, - ) as t.Statement, - client: babel.template.ast( - `import { createClientRpc } from '@tanstack/${framework}-start/client-rpc'`, - { placeholderPattern: false }, - ) as t.Statement, - ssr: babel.template.ast( - `import { createSsrRpc } from '@tanstack/${framework}-start/ssr-rpc'`, - { placeholderPattern: false }, - ) as t.Statement, - } - RuntimeCodeCache.set(framework, cache) - } - return cache[type] -} - -/** - * Environment-specific configuration for server function transformation. - * This is computed internally based on the compilation context. - */ -interface EnvConfig { - /** Whether this environment is a client environment */ - isClientEnvironment: boolean - /** The runtime code type to use for imports */ - runtimeCodeType: RuntimeCodeType -} - -/** - * Gets the environment configuration for the current compilation context. - */ -function getEnvConfig( - context: CompilationContext, - isProviderFile: boolean, -): EnvConfig { - const { env } = context - - if (isProviderFile) { - return { - isClientEnvironment: false, - runtimeCodeType: 'provider', - } - } - - if (env === 'client') { - return { - isClientEnvironment: true, - runtimeCodeType: 'client', - } - } - - // Server caller (SSR) - return { - isClientEnvironment: false, - runtimeCodeType: 'ssr', - } -} - -/** - * Builds the serverFnMeta object literal AST node. - * The object contains: { id, name, filename } - */ -function buildServerFnMetaObject( - functionId: string, - variableName: string, - filename: string, -): t.ObjectExpression { - return t.objectExpression([ - t.objectProperty(t.identifier('id'), t.stringLiteral(functionId)), - t.objectProperty(t.identifier('name'), t.stringLiteral(variableName)), - t.objectProperty(t.identifier('filename'), t.stringLiteral(filename)), - ]) -} - -/** - * Generates the RPC stub expression for provider files. - * Uses pre-compiled template for performance. - */ -function generateProviderRpcStub( - serverFnMeta: t.ObjectExpression, - fn: t.Expression, -): t.Expression { - return serverRpcTemplate({ - serverFnMeta, - fn, - }) -} - -/** - * Generates the RPC stub expression for caller files. - * Uses pre-compiled templates for performance. - * Note: Client and SSR callers only receive the functionId string, not the full metadata. - */ -function generateCallerRpcStub( - functionId: string, - envConfig: EnvConfig, -): t.Expression { - const functionIdLiteral = t.stringLiteral(functionId) - - if (envConfig.runtimeCodeType === 'client') { - return clientRpcTemplate({ - functionId: functionIdLiteral, - }) - } - - return ssrRpcManifestTemplate({ - functionId: functionIdLiteral, - }) -} - -/** - * Handles createServerFn transformations for a batch of candidates. - * - * This function performs extraction and replacement of server functions - * - * For caller files (non-provider): - * - Replaces the server function with an RPC stub - * - Does not include the handler function body - * - * For provider files: - * - Creates an extractedFn that calls __executeServer - * - Modifies .handler() to pass (extractedFn, serverFn) - two arguments - * - * @param candidates - All ServerFn candidates to process - * @param context - The compilation context with helpers and mutable state - * @returns Result containing runtime code to add, or null if no candidates processed - */ export function handleCreateServerFn( candidates: Array, context: CompilationContext, @@ -215,350 +20,221 @@ export function handleCreateServerFn( if (candidates.length === 0) { return } - - const isProviderFile = context.id.includes(TSS_SERVERFN_SPLIT_PARAM) - if (isProviderFile && context.serverFnProviderModuleDirectives) { - ensureDirectivePrologue( - context.ast, - context.serverFnProviderModuleDirectives, - ) - } - - // Get environment-specific configuration - const envConfig = getEnvConfig(context, isProviderFile) - - // Track function names to ensure uniqueness within this file - const functionNameSet = new Set() - + const isProvider = context.id.includes(TSS_SERVERFN_SPLIT_PARAM) + const runtime = isProvider + ? 'provider' + : context.env === 'client' + ? 'client' + : 'ssr' + const runtimeName = + runtime === 'provider' + ? 'createServerRpc' + : runtime === 'client' + ? 'createClientRpc' + : 'createSsrRpc' + const functionNames = new Set() const exportNames = new Set() const serverFnsById: Record = {} - const [baseFilename] = context.id.split('?') as [string] const extractedFilename = `${baseFilename}?${TSS_SERVERFN_SPLIT_PARAM}` const relativeFilename = path.relative(context.root, baseFilename) const knownFns = context.getKnownServerFns() - const cleanedContextId = cleanId(context.id) - for (const candidate of candidates) { - const { path: candidatePath, methodChain } = candidate - const { validator, inputValidator, handler } = methodChain - - const candidateVariableDeclarator = getVariableDeclaratorForExpressionPath( - candidatePath as babel.NodePath, - ) - - // Check if the call is assigned to a variable - if (!candidateVariableDeclarator) { + for (const { node, methodChain } of candidates) { + const declarator = getVariableDeclarator(node, context.parentOf) + if (!declarator) { throw new Error('createServerFn must be assigned to a variable!') } - - // Get the identifier name of the variable - const variableDeclarator = candidateVariableDeclarator.node - if (!t.isIdentifier(variableDeclarator.id)) { + if (!is.Identifier(declarator.id)) { throw codeFrameError( context.code, - variableDeclarator.id.loc!, + declarator.id, 'createServerFn must be assigned to a simple identifier, not a destructuring pattern', ) } - const existingVariableName = variableDeclarator.id.name - - // Generate unique function name with _createServerFn_handler suffix - // The function name is derived from the variable name - let functionName = `${existingVariableName}_createServerFn_handler` - while (functionNameSet.has(functionName)) { + const variableName = declarator.id.name + let functionName = `${variableName}_createServerFn_handler` + while (functionNames.has(functionName)) { functionName = incrementFunctionNameVersion(functionName) } - functionNameSet.add(functionName) - - // Generate function ID using pre-computed relative filename + functionNames.add(functionName) const functionId = context.generateFunctionId({ filename: relativeFilename, functionName, extractedFilename, }) - - // Check if this function was already discovered by the client build const knownFn = knownFns[functionId] - // A server function is client-referenced when: - // 1. We're in the client (browser) environment, OR - // 2. It was already discovered by another environment (knownFn), OR - // 3. We're in an SSR caller environment — any server function reachable from - // SSR module graph is callable via client navigation HTTP requests - const isClientReferenced = - envConfig.isClientEnvironment || - !!knownFn || - envConfig.runtimeCodeType === 'ssr' - - // Use canonical extracted filename from known functions if available - const canonicalExtractedFilename = - knownFn?.extractedFilename ?? extractedFilename - - // TODO remove upon stable - if (inputValidator) { - warnInputValidatorDeprecation(context, inputValidator) + if (methodChain.inputValidator) { + const location = sourcePosition( + context.code, + methodChain.inputValidator.call.start, + ) + context.warn?.( + `${context.id}:${location.line}:${location.column + 1} createServerFn().inputValidator() is deprecated. Use createServerFn().validator() instead.`, + ) } - - // Handle validators - remove on client - for (const [methodName, methodCall] of [ - ['validator', validator], - // TODO remove upon stable - ['inputValidator', inputValidator], + for (const [name, method] of [ + ['validator', methodChain.validator], + ['inputValidator', methodChain.inputValidator], ] as const) { - if (!methodCall) { + if (!method) { continue } - - const innerInputExpression = methodCall.callPath.node.arguments[0] - - if (!innerInputExpression) { + if (!method.call.arguments[0]) { throw new Error( - `createServerFn().${methodName}() must be called with a validator!`, + `createServerFn().${name}() must be called with a validator!`, ) } - - // If we're on the client, remove the validator call expression if (context.env === 'client') { - stripMethodCall(methodCall.callPath) + stripMethodCall(method.call, context) } } - - const handlerFnPath = handler?.firstArgPath - - if (!handler || !handlerFnPath?.node) { + const handler = methodChain.handler + if (!handler?.firstArg) { throw codeFrameError( context.code, - candidatePath.node.callee.loc!, - `createServerFn must be called with a "handler" property!`, + node.callee, + 'createServerFn must be called with a "handler" property!', ) } - - // Validate the handler argument is an expression (not a SpreadElement, etc.) - if (!t.isExpression(handlerFnPath.node)) { + if (!is.Expression(handler.firstArg)) { throw codeFrameError( context.code, - handlerFnPath.node.loc!, - `handler() must be called with an expression, not a ${handlerFnPath.node.type}`, + handler.firstArg, + `handler() must be called with an expression, not a ${handler.firstArg.type}`, ) } - - const handlerFn = handlerFnPath.node - - // Register function only from caller files (not provider files) - // to avoid duplicates - provider files process the same functions - - if (!isProviderFile) { + if (!isProvider) { serverFnsById[functionId] = { functionName, functionId, - filename: cleanedContextId, - extractedFilename: canonicalExtractedFilename, - isClientReferenced, + filename: cleanId(context.id), + extractedFilename: knownFn?.extractedFilename ?? extractedFilename, + isClientReferenced: + context.env === 'client' || !!knownFn || runtime === 'ssr', } - } - - if (isProviderFile) { - // PROVIDER FILE: This is the extracted file that contains the actual implementation - // We need to: - // 1. Create an extractedFn that calls __executeServer - // 2. Modify .handler() to pass (extractedFn, serverFn) - two arguments - // - // Expected output format: - // const extractedFn = createServerRpc({id, name, filename}, (opts) => varName.__executeServer(opts)); - // const varName = createServerFn().handler(extractedFn, originalHandler); - - // Build the arrow function: (opts) => varName.__executeServer(opts) - // The signal parameter is passed through to allow abort signal propagation - const executeServerArrowFn = t.arrowFunctionExpression( - [t.identifier('opts')], - t.callExpression( - t.memberExpression( - t.identifier(existingVariableName), - t.identifier('__executeServer'), - ), - [t.identifier('opts')], - ), + context.replaceNode( + handler.firstArg, + parseExpression(`${runtimeName}(${JSON.stringify(functionId)})`), ) - - // Build the serverFnMeta object - const serverFnMeta = buildServerFnMetaObject( - functionId, - existingVariableName, - relativeFilename, - ) - - // Generate the replacement using pre-compiled template - const extractedFnInit = generateProviderRpcStub( - serverFnMeta, - executeServerArrowFn, - ) - - // Build the extracted function statement - const extractedFnStatement = t.variableDeclaration('const', [ - t.variableDeclarator(t.identifier(functionName), extractedFnInit), - ]) - - // Find the variable declaration statement containing our createServerFn - const variableDeclaration = candidateVariableDeclarator.parentPath - if (!variableDeclaration.isVariableDeclaration()) { - throw new Error( - 'Expected createServerFn to be in a VariableDeclaration', - ) - } - - // Insert the extracted function statement before the variable declaration - variableDeclaration.insertBefore(extractedFnStatement) - - // Modify the .handler() call to pass two arguments: (extractedFn, serverFn) - // The handlerFnPath.node contains the original serverFn - const extractedFnIdentifier = t.identifier(functionName) - const serverFnNode = t.cloneNode(handlerFn, true) - - // Replace handler's arguments with [extractedFn, serverFn] - handler.callPath.node.arguments = [extractedFnIdentifier, serverFnNode] - - // Only export the extracted handler (e.g., myFn_createServerFn_handler) - // The manifest and all import paths only look up this suffixed name. - // The original variable (e.g., myFn) stays in the file but is not exported - // since it's only used internally. - exportNames.add(functionName) - } else { - // CALLER FILE: This file calls the server function but doesn't contain the implementation - // We need to: - // 1. Remove the handler function body (it will be in the provider file) - // 2. Replace the handler argument with an RPC stub - // - // IMPORTANT: We must keep the createServerFn().handler(extractedFn) structure - // so that the client middleware chain can unwrap the {result, error, context} response. - // - // Expected output format: - // const myFn = createServerFn().handler(createClientRpc("id")) - // or - // const myFn = createServerFn().handler(createSsrRpc("id")) - - // Generate the RPC stub using pre-compiled templates - // Note: Caller files only pass functionId, not the full serverFnMeta - const rpcStub = generateCallerRpcStub(functionId, envConfig) - - // Replace ONLY the handler argument with the RPC stub - // Keep the createServerFn().handler() wrapper intact for client middleware - handlerFnPath.replaceWith(rpcStub) + continue + } + const declaration = context.parentOf(declarator) + if (!is.VariableDeclaration(declaration)) { + throw new Error('Expected createServerFn to be in a VariableDeclaration') } + const parent = context.parentOf(declaration) + const statement = is.ExportNamedDeclaration(parent) ? parent : declaration + const container = is.ExportNamedDeclaration(parent) + ? context.parentOf(parent) + : parent + if (!is.Program(container) && !is.BlockStatement(container)) { + throw new Error('Expected createServerFn declaration in a statement list') + } + const statements: Array = container.body + const statementIndex = statements.indexOf(statement) + const metadata = JSON.stringify({ + id: functionId, + name: variableName, + filename: relativeFilename, + }) + const extracted = parseStatements( + `const ${functionName} = createServerRpc(${metadata}, (opts) => ${variableName}.__executeServer(opts));`, + )[0]! + statements.splice(statementIndex, 0, extracted) + // Move the existing handler node; its source-binding identity remains intact. + handler.call.arguments = [parseExpression(functionName), handler.firstArg] + exportNames.add(functionName) } - // For provider files, add exports for all extracted functions - if (isProviderFile) { - // Remove all existing exports first - safeRemoveExports(context.ast) - - // Export all server function related variables from exportNames - // These were populated by handleCreateServerFn: - // 1. Extracted handlers: const fn_createServerFn_handler = createServerRpc(...) - // 2. Original variables: const fn = createServerFn().handler(...) - if (exportNames.size > 0) { - context.ast.program.body.push( - t.exportNamedDeclaration( - undefined, - Array.from(exportNames).map((name) => - t.exportSpecifier(t.identifier(name), t.identifier(name)), + if (isProvider) { + removeExports(context.ast) + if (exportNames.size) { + context.ast.body.push( + b.ExportNamedDeclaration({ + declaration: null, + source: null, + attributes: [], + exportKind: 'value', + specifiers: [...exportNames].map((name) => + b.ExportSpecifier({ + local: b.Identifier({ name }), + exported: b.Identifier({ name }), + exportKind: 'value', + }), ), - ), + }), ) } - if (context.mode === 'dev') { - context.ast.program.body.push(...providerHmrAcceptTemplate()) + context.ast.body.push( + ...parseStatements( + 'if (import.meta.hot) { import.meta.hot.accept(() => {}); } if (import.meta.webpackHot) { import.meta.webpackHot.accept(() => {}); }', + ), + ) } + const existing = new Set( + context.ast.body.filter(is.Directive).map((node) => node.directive), + ) + const missing = (context.serverFnProviderModuleDirectives ?? []).filter( + (directive) => { + if (!directive || existing.has(directive)) { + return false + } + existing.add(directive) + return true + }, + ) + context.ast.body.unshift( + ...parseStatements( + missing.map((directive) => `${JSON.stringify(directive)};`).join('\n'), + ), + ) + } else if (Object.keys(serverFnsById).length) { + context.onServerFnsById?.(serverFnsById) } - - // Notify about discovered functions (only for non-provider files) - if (!isProviderFile && hasKeys(serverFnsById) && context.onServerFnsById) { - context.onServerFnsById(serverFnsById) + let importIndex = 0 + while (is.Directive(context.ast.body[importIndex])) { + importIndex++ } - - // Add runtime import using cached AST node - const runtimeCode = getCachedRuntimeCode( - context.framework, - envConfig.runtimeCodeType, + const importPath = runtime === 'provider' ? 'server-rpc' : `${runtime}-rpc` + context.ast.body.splice( + importIndex, + 0, + ...parseStatements( + `import { ${runtimeName} } from '@tanstack/${context.framework}-start/${importPath}';`, + ), ) - context.ast.program.body.unshift(t.cloneNode(runtimeCode)) -} - -/** - * Makes an identifier safe for use as a JavaScript identifier. - */ -function makeIdentifierSafe(identifier: string): string { - return identifier - .replace(/[^a-zA-Z0-9_$]/g, '_') // Replace unsafe chars with underscore - .replace(/^[0-9]/, '_$&') // Prefix leading number with underscore - .replace(/^\$/, '_$') // Prefix leading $ with underscore - .replace(/_{2,}/g, '_') // Collapse multiple underscores - .replace(/^_|_$/g, '') // Trim leading/trailing underscores } -/** - * Increments the version number suffix on a function name. - */ -function incrementFunctionNameVersion(functionName: string): string { - const [realReferenceName, count] = functionName.split(/_(\d+)$/) - const resolvedCount = Number(count || '0') - const suffix = `_${resolvedCount + 1}` - return makeIdentifierSafe(realReferenceName!) + suffix +function incrementFunctionNameVersion(name: string): string { + const [base, count] = name.split(/_(\d+)$/) + return ( + base! + .replace(/[^a-zA-Z0-9_$]/g, '_') + .replace(/^[0-9]/, '_$&') + .replace(/^\$/, '_$') + .replace(/_{2,}/g, '_') + .replace(/^_|_$/g, '') + `_${Number(count || '0') + 1}` + ) } -/** - * Removes all exports from the AST while preserving the declarations. - * Used for provider files where we want to re-export only the server functions. - */ -function safeRemoveExports(ast: t.File): void { - ast.program.body = ast.program.body.flatMap((node) => { - if ( - t.isExportNamedDeclaration(node) || - t.isExportDefaultDeclaration(node) - ) { +function removeExports(program: Program) { + program.body = program.body.flatMap((node) => { + if (is.ExportNamedDeclaration(node) || is.ExportDefaultDeclaration(node)) { if ( - t.isFunctionDeclaration(node.declaration) || - t.isClassDeclaration(node.declaration) || - t.isVariableDeclaration(node.declaration) + is.FunctionDeclaration(node.declaration) || + is.ClassDeclaration(node.declaration) ) { - // do not remove export if it is an anonymous function / class, - // otherwise this would produce a syntax error - if ( - t.isFunctionDeclaration(node.declaration) || - t.isClassDeclaration(node.declaration) - ) { - if (!node.declaration.id) { - return node - } - } - return node.declaration - } else if (node.declaration === null) { - // remove e.g. `export { RouteComponent as component }` + return node.declaration.id ? [node.declaration] : [node] + } + if (is.VariableDeclaration(node.declaration)) { + return [node.declaration] + } + if (!node.declaration) { return [] } } - return node + return [node] }) } - -function ensureDirectivePrologue( - ast: t.File, - directiveValues: ReadonlyArray, -): void { - const directives = ast.program.directives - const existingDirectives = new Set( - directives.map((directive) => directive.value.value), - ) - const missingDirectives: Array = [] - - for (const directiveValue of directiveValues) { - if (!directiveValue || existingDirectives.has(directiveValue)) continue - - existingDirectives.add(directiveValue) - missingDirectives.push(directiveValue) - } - - for (let i = missingDirectives.length - 1; i >= 0; i--) { - directives.unshift(t.directive(t.directiveLiteral(missingDirectives[i]!))) - } -} diff --git a/packages/start-plugin-core/src/start-compiler/handleEnvOnly.ts b/packages/start-plugin-core/src/start-compiler/handleEnvOnly.ts index 1fa6ab21cfb..23110b3ad9e 100644 --- a/packages/start-plugin-core/src/start-compiler/handleEnvOnly.ts +++ b/packages/start-plugin-core/src/start-compiler/handleEnvOnly.ts @@ -1,54 +1,27 @@ -import * as t from '@babel/types' +import { is } from 'yuku-ast' +import { parseExpression } from '@tanstack/router-utils' import type { CompilationContext, RewriteCandidate } from './types' import type { LookupKind } from './compiler' -function capitalize(str: string) { - if (!str) return '' - return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase() -} - -/** - * Handles serverOnly/clientOnly function transformations for a batch of candidates. - * - * @param candidates - All EnvOnly candidates to process (all same kind) - * @param context - The compilation context - * @param kind - The specific kind (ServerOnlyFn or ClientOnlyFn) - */ export function handleEnvOnlyFn( candidates: Array, context: CompilationContext, kind: LookupKind, ): void { - const targetEnv = kind === 'ClientOnlyFn' ? 'client' : 'server' - - for (const candidate of candidates) { - const { path } = candidate - - if (context.env === targetEnv) { - // Matching environment - extract the inner function - const innerFn = path.node.arguments[0] - - if (!t.isExpression(innerFn)) { - throw new Error( - `create${capitalize(targetEnv)}OnlyFn() must be called with a function!`, - ) + const target = kind === 'ClientOnlyFn' ? 'client' : 'server' + const factory = `create${target[0]!.toUpperCase()}${target.slice(1)}OnlyFn` + for (const { node } of candidates) { + if (context.env === target) { + const argument = node.arguments[0] + if (!is.Expression(argument)) { + throw new Error(`${factory}() must be called with a function!`) } - - path.replaceWith(innerFn) + context.replaceNode(node, argument) } else { - // Wrong environment - replace with a function that throws an error - path.replaceWith( - t.arrowFunctionExpression( - [], - t.blockStatement([ - t.throwStatement( - t.newExpression(t.identifier('Error'), [ - t.stringLiteral( - `create${capitalize(targetEnv)}OnlyFn() functions can only be called on the ${targetEnv}!`, - ), - ]), - ), - ]), + context.replaceNode( + node, + parseExpression( + `() => { throw new Error(${JSON.stringify(`${factory}() functions can only be called on the ${target}!`)}); }`, ), ) } diff --git a/packages/start-plugin-core/src/start-compiler/types.ts b/packages/start-plugin-core/src/start-compiler/types.ts index 1371e7a9735..8cb0f6ae7b5 100644 --- a/packages/start-plugin-core/src/start-compiler/types.ts +++ b/packages/start-plugin-core/src/start-compiler/types.ts @@ -1,5 +1,4 @@ -import type * as babel from '@babel/core' -import type * as t from '@babel/types' +import type { CallExpression } from '@yuku-toolchain/types' import type { StartCompilerTransformContext } from '../types' /** @@ -33,17 +32,17 @@ export type BatchedPluginHandler = ( ) => void /** - * Info about a method call in the chain, including the call expression path - * and the path to its first argument (if any). + * Info about a method call in the chain, including the call expression + * and its first argument (if any). */ export interface MethodCallInfo { - callPath: babel.NodePath - /** Path to the first argument, or null if no arguments */ - firstArgPath: babel.NodePath | null + call: CallExpression + /** First argument, or null if no arguments. */ + firstArg: CallExpression['arguments'][number] | null } /** - * Pre-collected method chain paths for a root call expression. + * Pre-collected native method-chain nodes for a root call expression. * This avoids needing to traverse the AST again in handlers. */ export interface MethodChainPaths { @@ -62,7 +61,7 @@ export type MethodChainKey = keyof MethodChainPaths * Information about a candidate that needs to be rewritten. */ export interface RewriteCandidate { - path: babel.NodePath + node: CallExpression methodChain: MethodChainPaths } diff --git a/packages/start-plugin-core/src/start-compiler/utils.ts b/packages/start-plugin-core/src/start-compiler/utils.ts index 384a13113d2..4db682cc4b1 100644 --- a/packages/start-plugin-core/src/start-compiler/utils.ts +++ b/packages/start-plugin-core/src/start-compiler/utils.ts @@ -1,39 +1,38 @@ -import { codeFrameColumns } from '@babel/code-frame' -import * as t from '@babel/types' -import type babel from '@babel/core' +import { is, walk } from 'yuku-ast' +import { unwrapExpression } from '@tanstack/router-utils' +import type { + CallExpression, + Node, + Program, + VariableDeclarator, +} from '@yuku-toolchain/types' +import type { StartCompilerTransformContext } from '../types' + +export function sourcePosition(code: string, offset: number) { + const before = code.slice(0, offset) + const lines = before.split('\n') + return { line: lines.length, column: lines[lines.length - 1]!.length } +} export function codeFrameError( code: string, - loc: { - start: { line: number; column: number } - end: { line: number; column: number } - }, + node: Pick, message: string, ) { - const frame = codeFrameColumns( - code, - { - start: loc.start, - end: loc.end, - }, - { - highlightCode: true, - message, - }, - ) - + const start = sourcePosition(code, node.start) + const lines = code.split('\n') + const frame = lines + .slice(Math.max(0, start.line - 2), start.line + 1) + .map((line, index) => { + const number = Math.max(1, start.line - 1) + index + return `${number} | ${line}${number === start.line ? `\n | ${' '.repeat(start.column)}^ ${message}` : ''}` + }) + .join('\n') return new Error(frame) } -/** - * Converts a bundler module ID to its physical-file identity for diagnostics, - * filesystem matching, and file-based invalidation. - * - * Do not use this for IDs passed to resolve/load hooks or as module cache keys: - * virtual prefixes and queries can be part of the module's semantic identity. - */ +/** Keep semantic module IDs intact; this is only for physical-file matching. */ export function cleanId(id: string): string { - // Remove null byte prefix used by Vite/Rollup for virtual modules if (id.startsWith('\0')) { id = id.slice(1) } @@ -41,19 +40,74 @@ export function cleanId(id: string): string { return queryIndex === -1 ? id : id.substring(0, queryIndex) } -/** - * Strips a method call by replacing it with its callee object. - * E.g., `foo().bar()` -> `foo()` - * - * This is a common pattern used when removing method calls from chains - * (e.g., removing .server() from middleware on client, or .validator() on client). - * - * @param callPath - The path to the CallExpression to strip - */ +/** Output-tree edits use native node identity; semantic queries use the source module. */ +export function createAstEditor(ast: Program) { + const parents = new WeakMap() + function indexSubtree(root: Node) { + walk(root, { + enter(node, context) { + if (context.parent && context.key) { + parents.set(node, { parent: context.parent, key: context.key }) + } + }, + }) + } + indexSubtree(ast) + return { + parentOf(node: Node): Node | null { + return parents.get(node)?.parent ?? null + }, + replaceNode(node: Node, replacement: Node): void { + const position = parents.get(node) + if (!position) { + throw new Error('Cannot replace a node outside the output tree') + } + const record = position.parent as unknown as Record + const field = record[position.key] + if (Array.isArray(field)) { + const index = field.indexOf(node) + if (index < 0) { + throw new Error('Cannot replace a detached output node') + } + field[index] = replacement + } else { + record[position.key] = replacement + } + parents.set(replacement, position) + indexSubtree(replacement) + }, + } +} + +export function getVariableDeclarator( + node: Node, + parentOf: (node: Node) => Node | null, +): VariableDeclarator | null { + let parent = parentOf(node) + while ( + parent && + is.oneOf(parent, [ + 'ParenthesizedExpression', + 'TSAsExpression', + 'TSSatisfiesExpression', + 'TSNonNullExpression', + 'TSTypeAssertion', + ]) + ) { + node = parent + parent = parentOf(node) + } + return is.VariableDeclarator(parent) && parent.init === node ? parent : null +} + export function stripMethodCall( - callPath: babel.NodePath, + call: CallExpression, + context: StartCompilerTransformContext, ): void { - if (t.isMemberExpression(callPath.node.callee)) { - callPath.replaceWith(callPath.node.callee.object) + const callee = is.Expression(call.callee) + ? unwrapExpression(call.callee) + : call.callee + if (is.MemberExpression(callee)) { + context.replaceNode(call, callee.object) } } diff --git a/packages/start-plugin-core/src/types.ts b/packages/start-plugin-core/src/types.ts index 6ed89244f4f..57207cde9e5 100644 --- a/packages/start-plugin-core/src/types.ts +++ b/packages/start-plugin-core/src/types.ts @@ -1,6 +1,11 @@ -import type * as babel from '@babel/core' -import type * as t from '@babel/types' -import type { GeneratorResult } from '@tanstack/router-utils' +import type { + CallExpression, + Expression, + Node, + Program, +} from '@yuku-toolchain/types' +import type { Module } from 'yuku-analyzer' +import type { GenerateResult } from '@tanstack/router-utils' import type { TanStackStartOutputConfig } from './schema' export type CompileStartFrameworkOptions = 'react' | 'solid' | 'vue' @@ -31,11 +36,15 @@ export interface StartCompilerImportTransformImport { } export interface StartCompilerTransformCandidate { - path: babel.NodePath + node: CallExpression } export interface StartCompilerTransformContext { - readonly ast: t.File + readonly ast: Program + readonly module: Module + readonly originalNodes: WeakMap + replaceNode: (node: Node, replacement: Node) => void + parentOf: (node: Node) => Node | null readonly code: string readonly id: string readonly env: StartCompilerEnvironment @@ -44,8 +53,7 @@ export interface StartCompilerTransformContext { readonly root: string readonly framework: CompileStartFrameworkOptions readonly providerEnvName: string - readonly types: typeof t - parseExpression: (code: string) => t.Expression + parseExpression: (code: string) => Expression warn?: (message: string) => void } @@ -66,7 +74,7 @@ export interface StartCompilerImportTransform { export interface StartCompilerTransformResult { code: string - map?: GeneratorResult['map'] | null + map?: GenerateResult['map'] | null } export interface StartCompilerVirtualModuleContext { diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyBasic.tsx b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyBasic.tsx index 82195ff7392..8ce657ff9a7 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyBasic.tsx +++ b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyBasic.tsx @@ -1,6 +1,6 @@ import { ClientOnly } from '@tanstack/react-router'; export function MyComponent() { - return
+ return (
Loading...
} /> -
; +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyMultiple.tsx b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyMultiple.tsx index f437f41b051..8b51d166a9c 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyMultiple.tsx +++ b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyMultiple.tsx @@ -1,8 +1,8 @@ import { ClientOnly } from '@tanstack/react-router'; export function MyComponent() { - return
+ return (
Loading video...} />

Some server content

Loading audio...} /> -
; +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNested.tsx b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNested.tsx index 9d48d6577db..da18a0990f3 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNested.tsx +++ b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNested.tsx @@ -1,6 +1,6 @@ import { ClientOnly } from '@tanstack/react-router'; export function MyComponent() { - return
+ return (
Outer loading
} /> -
; +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNoFallback.tsx b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNoFallback.tsx index 9224aeb1cf6..ab8307f9737 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNoFallback.tsx +++ b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyNoFallback.tsx @@ -1,6 +1,6 @@ import { ClientOnly } from '@tanstack/react-router'; export function MyComponent() { - return
+ return (
-
; +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyRenamed.tsx b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyRenamed.tsx index de9e376b635..7ca64e77a77 100644 --- a/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyRenamed.tsx +++ b/packages/start-plugin-core/tests/clientOnlyJSX/snapshots/server/clientOnlyRenamed.tsx @@ -1,7 +1,7 @@ // Test: ClientOnly imported with an alias should still be transformed import { ClientOnly as CO } from '@tanstack/react-router'; export function MyComponent() { - return
+ return (
Loading...
} /> -
; + ); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/compiler.test.ts b/packages/start-plugin-core/tests/compiler.test.ts index c3ea245facf..ff7d7978ff2 100644 --- a/packages/start-plugin-core/tests/compiler.test.ts +++ b/packages/start-plugin-core/tests/compiler.test.ts @@ -91,18 +91,10 @@ function createExternalTransformCompiler() { ], detect: /\brenderThing\b/, transform: (candidates, context) => { - const t = context.types for (const candidate of candidates) { - const args = candidate.path.node.arguments + const args = candidate.node.arguments if (args.length !== 1) continue - args.push( - t.objectExpression([ - t.objectProperty( - t.identifier('injected'), - context.parseExpression('loadThing()'), - ), - ]), - ) + args.push(context.parseExpression('({ injected: loadThing() })')) } }, }, @@ -1296,6 +1288,40 @@ describe('re-export chain resolution', () => { }) }) +test('resolves distinct re-export aliases without conflating their source bindings', async () => { + const sources: Record = { + './barrel': `export { wrap as allowed } from './server'; export { wrap as denied } from './client'`, + './server': `export { createServerOnlyFn as wrap } from '@tanstack/start-fn-stubs'`, + './client': `export { createClientOnlyFn as wrap } from '@tanstack/start-fn-stubs'`, + } + const compiler: StartCompiler = new StartCompiler({ + ...getDefaultTestOptions('server'), + env: 'server', + mode: 'build', + lookupKinds: getLookupKindsForEnv('server'), + lookupConfigurations: getLookupConfigurationsForEnv('server', 'react'), + getKnownServerFns: () => ({}), + resolveId: async (id) => (sources[id] ? id : null), + loadModule: async (id) => { + if (sources[id]) { + compiler.ingestModule({ id, code: sources[id] }) + } + }, + }) + const result = await compiler.compile({ + id: '/test/entry.ts', + code: `import { allowed, denied } from './barrel'; export const a = allowed(() => 'server-value'); export const b = denied(() => 'client-value')`, + }) + expect(result).not.toBeNull() + expect(result!.code).not.toContain('./barrel') + const evaluate = new Function( + `${result!.code.replace(/\bexport (?=const)/g, '')}\nreturn { a, b }`, + ) + const { a, b } = evaluate() + expect(a()).toBe('server-value') + expect(() => b()).toThrow('can only be called on the client') +}) + test('leaves unrelated SSR middleware chains to the bundler when a server function factory is present', async () => { const compiler = new StartCompiler({ ...getDefaultTestOptions('server'), @@ -1357,22 +1383,17 @@ test('compiles a server function through a parenthesized namespace receiver', as expect(result!.code).toContain('createClientRpc') }) -// The compiler currently mistakes the local parameter for the namespace import. -// Keep the intended behavior executable until binding resolution is corrected. -test.fails( - 'preserves a shadowed parenthesized namespace receiver', - async () => { - const compiler = createFullCompiler('client') - const code = `import * as Start from '@tanstack/react-start'; export function fn(Start) { return (Start).createServerFn().handler(() => 'local-runtime-body') }` - const result = await compiler.compile({ - id: '/test/shadowed-namespace.ts', - code, - }) - const output = result?.code ?? code - expect(output).toContain('local-runtime-body') - expect(output).not.toContain('createClientRpc') - }, -) +test('preserves a shadowed parenthesized namespace receiver', async () => { + const compiler = createFullCompiler('client') + const code = `import * as Start from '@tanstack/react-start'; export function fn(Start) { return (Start).createServerFn().handler(() => 'local-runtime-body') }` + const result = await compiler.compile({ + id: '/test/shadowed-namespace.ts', + code, + }) + const output = result?.code ?? code + expect(output).toContain('local-runtime-body') + expect(output).not.toContain('createClientRpc') +}) test.each([ `(Start).createServerOnlyFn(() => 'private-server-body')`, diff --git a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnFactory.tsx b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnFactory.tsx index b54ad664b13..a8bcd73bc14 100644 --- a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnFactory.tsx +++ b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnFactory.tsx @@ -1,15 +1,12 @@ import { createIsomorphicFn } from '@tanstack/react-start'; - // Isomorphic function factory - returns a createIsomorphicFn with .client() and .server() calls export function createPlatformFn(platform: string) { return () => `client-${platform}`; } - // Arrow function factory with only server implementation export const createServerImplFn = (name: string) => { return () => {}; }; - // Arrow function factory with only client implementation export const createClientImplFn = (name: string) => { return () => { @@ -17,11 +14,9 @@ export const createClientImplFn = (name: string) => { return `client-${name}`; }; }; - // Factory returning no-implementation isomorphic fn export function createNoImplFn() { return createIsomorphicFn(); } - // Top-level isomorphic fn for comparison export const topLevelIsomorphicFn = () => 'client'; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnInline.tsx b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnInline.tsx index 09666623a62..923d30be849 100644 --- a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnInline.tsx +++ b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/client/createIsomorphicFnInline.tsx @@ -3,34 +3,26 @@ export function getPlatformValue() { const fn = () => 'client-value'; return fn(); } - // Arrow function that creates and invokes isomorphic fn export const getEnvironment = () => { const envFn = () => 'running on client'; return envFn(); }; - // Create isomorphic fn inline without assigning to variable export function getDirectValue() { return (() => 'direct-client')(); } - // Multiple isomorphic fns created and used in same function export function getMultipleValues() { const first = () => 'first-client'; const second = () => 'second-client'; - return { - first: first(), - second: second() - }; + return { first: first(), second: second() }; } - // Isomorphic fn with server-only implementation used inline export function getServerOnlyValue() { const fn = () => {}; return fn(); } - // Isomorphic fn with client-only implementation used inline export function getClientOnlyValue() { const fn = () => { diff --git a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnFactory.tsx b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnFactory.tsx index cce206bc8b6..7caca7130f5 100644 --- a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnFactory.tsx +++ b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnFactory.tsx @@ -1,10 +1,8 @@ import { createIsomorphicFn } from '@tanstack/react-start'; - // Isomorphic function factory - returns a createIsomorphicFn with .client() and .server() calls export function createPlatformFn(platform: string) { return () => `server-${platform}`; } - // Arrow function factory with only server implementation export const createServerImplFn = (name: string) => { return () => { @@ -12,16 +10,13 @@ export const createServerImplFn = (name: string) => { return `server-${name}`; }; }; - // Arrow function factory with only client implementation export const createClientImplFn = (name: string) => { return () => {}; }; - // Factory returning no-implementation isomorphic fn export function createNoImplFn() { return createIsomorphicFn(); } - // Top-level isomorphic fn for comparison export const topLevelIsomorphicFn = () => 'server'; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnInline.tsx b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnInline.tsx index 9c058dfae86..2b12e28b845 100644 --- a/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnInline.tsx +++ b/packages/start-plugin-core/tests/createIsomorphicFn/snapshots/server/createIsomorphicFnInline.tsx @@ -3,28 +3,21 @@ export function getPlatformValue() { const fn = () => 'server-value'; return fn(); } - // Arrow function that creates and invokes isomorphic fn export const getEnvironment = () => { const envFn = () => 'running on server'; return envFn(); }; - // Create isomorphic fn inline without assigning to variable export function getDirectValue() { return (() => 'direct-server')(); } - // Multiple isomorphic fns created and used in same function export function getMultipleValues() { const first = () => 'first-server'; const second = () => 'second-server'; - return { - first: first(), - second: second() - }; + return { first: first(), second: second() }; } - // Isomorphic fn with server-only implementation used inline export function getServerOnlyValue() { const fn = () => { @@ -33,7 +26,6 @@ export function getServerOnlyValue() { }; return fn(); } - // Isomorphic fn with client-only implementation used inline export function getClientOnlyValue() { const fn = () => {}; diff --git a/packages/start-plugin-core/tests/createMiddleware/createMiddleware.test.ts b/packages/start-plugin-core/tests/createMiddleware/createMiddleware.test.ts index 4747cfc848d..5dc45e44190 100644 --- a/packages/start-plugin-core/tests/createMiddleware/createMiddleware.test.ts +++ b/packages/start-plugin-core/tests/createMiddleware/createMiddleware.test.ts @@ -92,9 +92,7 @@ describe('createMiddleware compiles correctly', async () => { expect(result!.code).toMatchInlineSnapshot(` "import { createMiddleware } from '@tanstack/react-start'; - const myMiddleware = createMiddleware({ - type: 'function' - });" + const myMiddleware = createMiddleware({ type: 'function' });" `) }) diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/create-function-middleware.ts b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/create-function-middleware.ts index b37e25e4986..70b2b76783e 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/create-function-middleware.ts +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/create-function-middleware.ts @@ -1,6 +1,4 @@ import { createMiddleware } from '@tanstack/react-start'; -export const fnMw = createMiddleware({ - type: 'function' -}).client(() => { +export const fnMw = createMiddleware({ type: 'function' }).client(() => { console.log('client'); }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructured.tsx b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructured.tsx index b5cf588a1fc..4b47766910e 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructured.tsx +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructured.tsx @@ -1,13 +1,5 @@ import { createMiddleware } from '@tanstack/react-start'; -export const withUseServer = createMiddleware({ - id: 'test' -}); -export const withoutUseServer = createMiddleware({ - id: 'test' -}); -export const withVariable = createMiddleware({ - id: 'test' -}); -export const withZodValidator = createMiddleware({ - id: 'test' -}); \ No newline at end of file +export const withUseServer = createMiddleware({ id: 'test' }); +export const withoutUseServer = createMiddleware({ id: 'test' }); +export const withVariable = createMiddleware({ id: 'test' }); +export const withZodValidator = createMiddleware({ id: 'test' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructuredRename.tsx b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructuredRename.tsx index ee061797034..620643fef27 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructuredRename.tsx +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareDestructuredRename.tsx @@ -1,13 +1,5 @@ import { createMiddleware as middlewareFn } from '@tanstack/react-start'; -export const withUseServer = middlewareFn({ - id: 'test' -}); -export const withoutUseServer = middlewareFn({ - id: 'test' -}); -export const withVariable = middlewareFn({ - id: 'test' -}); -export const withZodValidator = middlewareFn({ - id: 'test' -}); \ No newline at end of file +export const withUseServer = middlewareFn({ id: 'test' }); +export const withoutUseServer = middlewareFn({ id: 'test' }); +export const withVariable = middlewareFn({ id: 'test' }); +export const withZodValidator = middlewareFn({ id: 'test' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareStarImport.tsx b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareStarImport.tsx index 6f2f40a2a32..3a9b71dd9a2 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareStarImport.tsx +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareStarImport.tsx @@ -1,13 +1,5 @@ import * as TanStackStart from '@tanstack/react-start'; -export const withUseServer = TanStackStart.createMiddleware({ - id: 'test' -}); -export const withoutUseServer = TanStackStart.createMiddleware({ - id: 'test' -}); -export const withVariable = TanStackStart.createMiddleware({ - id: 'test' -}); -export const withZodValidator = TanStackStart.createMiddleware({ - id: 'test' -}); \ No newline at end of file +export const withUseServer = TanStackStart.createMiddleware({ id: 'test' }); +export const withoutUseServer = TanStackStart.createMiddleware({ id: 'test' }); +export const withVariable = TanStackStart.createMiddleware({ id: 'test' }); +export const withZodValidator = TanStackStart.createMiddleware({ id: 'test' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareValidator.tsx b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareValidator.tsx index 3b1beac2c03..dc025d9b141 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareValidator.tsx +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createMiddlewareValidator.tsx @@ -1,4 +1,2 @@ import { createMiddleware } from '@tanstack/react-start'; -export const withUseServer = createMiddleware({ - id: 'test' -}); \ No newline at end of file +export const withUseServer = createMiddleware({ id: 'test' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createStart.tsx b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createStart.tsx index 8c3a7fc205a..0b4270bf743 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createStart.tsx +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/createStart.tsx @@ -1,13 +1,7 @@ import { createStart } from '@tanstack/react-start'; export const startInstance = createStart(() => {}); -export const serverFnMw = startInstance.createMiddleware({ - type: 'function' -}).client(({ - next -}) => { +export const serverFnMw = startInstance.createMiddleware({ type: 'function' }).client(({ next }) => { console.log('client mw'); return next(); }); -export const requestMw = startInstance.createMiddleware({ - type: 'request' -}); \ No newline at end of file +export const requestMw = startInstance.createMiddleware({ type: 'request' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/middleware-factory.ts b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/middleware-factory.ts index 6845bd0ef5d..a8ed2ae7fbd 100644 --- a/packages/start-plugin-core/tests/createMiddleware/snapshots/client/middleware-factory.ts +++ b/packages/start-plugin-core/tests/createMiddleware/snapshots/client/middleware-factory.ts @@ -1,20 +1,11 @@ import { createMiddleware } from '@tanstack/react-start'; - // Middleware factory function - returns a middleware with .server() call export function createPublicRateLimitMiddleware(keySuffix) { - return createMiddleware({ - type: 'function' - }); + return createMiddleware({ type: 'function' }); } - // Arrow function factory -export const createAuthMiddleware = requiredRole => { - return createMiddleware({ - type: 'function' - }); +export const createAuthMiddleware = (requiredRole) => { + return createMiddleware({ type: 'function' }); }; - // Top-level middleware for comparison -export const topLevelMiddleware = createMiddleware({ - id: 'topLevel' -}); \ No newline at end of file +export const topLevelMiddleware = createMiddleware({ id: 'topLevel' }); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts b/packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts index 230caf7173c..788e32fd04a 100644 --- a/packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts +++ b/packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts @@ -195,11 +195,7 @@ describe('createServerFn compiles correctly', async () => { const myFunc = () => { return 'hello from the server'; }; - const myServerFn_createServerFn_handler = createServerRpc({ - id: "2c205add8e6755de551521133ddff3d48859b1631add5f1bbe5c48a5664f319b", - name: "myServerFn", - filename: "src/test.ts" - }, opts => myServerFn.__executeServer(opts)); + const myServerFn_createServerFn_handler = createServerRpc({ "id": "2c205add8e6755de551521133ddff3d48859b1631add5f1bbe5c48a5664f319b", "name": "myServerFn", "filename": "src/test.ts" }, (opts) => myServerFn.__executeServer(opts)); const myServerFn = createServerFn().handler(myServerFn_createServerFn_handler, myFunc); export { myServerFn_createServerFn_handler };" `) @@ -344,20 +340,12 @@ describe('createServerFn compiles correctly', async () => { "import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createServerFn } from '@tanstack/react-start'; const exportedVar = 'exported'; - const exportedFn_createServerFn_handler = createServerRpc({ - id: "c306c96e9256c7604f2a6022c4c94eb89f863274c022bc45b03970f067ea9864", - name: "exportedFn", - filename: "src/test.ts" - }, opts => exportedFn.__executeServer(opts)); + const exportedFn_createServerFn_handler = createServerRpc({ "id": "c306c96e9256c7604f2a6022c4c94eb89f863274c022bc45b03970f067ea9864", "name": "exportedFn", "filename": "src/test.ts" }, (opts) => exportedFn.__executeServer(opts)); const exportedFn = createServerFn().handler(exportedFn_createServerFn_handler, async () => { return exportedVar; }); const nonExportedVar = 'non-exported'; - const nonExportedFn_createServerFn_handler = createServerRpc({ - id: "f4403dc0b18e216dfe0a9711cab028bc1b9768175daa9236d7115e29c99d76c2", - name: "nonExportedFn", - filename: "src/test.ts" - }, opts => nonExportedFn.__executeServer(opts)); + const nonExportedFn_createServerFn_handler = createServerRpc({ "id": "f4403dc0b18e216dfe0a9711cab028bc1b9768175daa9236d7115e29c99d76c2", "name": "nonExportedFn", "filename": "src/test.ts" }, (opts) => nonExportedFn.__executeServer(opts)); const nonExportedFn = createServerFn().handler(nonExportedFn_createServerFn_handler, async () => { return nonExportedVar; }); diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx index 2c0e54f9c9e..f2352b54366 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx @@ -1,23 +1,9 @@ import { createClientRpc } from '@tanstack/react-start/client-rpc'; import { createServerFn } from '@tanstack/react-start'; -export const withUseServer = createServerFn({ - method: 'GET' -}).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withArrowFunction = createServerFn({ - method: 'GET' -}).handler(createClientRpc("a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793")); -export const withArrowFunctionAndFunction = createServerFn({ - method: 'GET' -}).handler(createClientRpc("dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e")); -export const withoutUseServer = createServerFn({ - method: 'GET' -}).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = createServerFn({ - method: 'GET' -}).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = createServerFn({ - method: 'GET' -}).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); -export const withValidatorFn = createServerFn({ - method: 'GET' -}).handler(createClientRpc("5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44")); \ No newline at end of file +export const withUseServer = createServerFn({ method: 'GET' }).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withArrowFunction = createServerFn({ method: 'GET' }).handler(createClientRpc("a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793")); +export const withArrowFunctionAndFunction = createServerFn({ method: 'GET' }).handler(createClientRpc("dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e")); +export const withoutUseServer = createServerFn({ method: 'GET' }).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = createServerFn({ method: 'GET' }).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = createServerFn({ method: 'GET' }).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); +export const withValidatorFn = createServerFn({ method: 'GET' }).handler(createClientRpc("5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx index e55318337dc..1f6b11c56e9 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx @@ -1,14 +1,6 @@ import { createClientRpc } from '@tanstack/react-start/client-rpc'; import { createServerFn as serverFn } from '@tanstack/react-start'; -export const withUseServer = serverFn({ - method: 'GET' -}).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withoutUseServer = serverFn({ - method: 'GET' -}).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = serverFn({ - method: 'GET' -}).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = serverFn({ - method: 'GET' -}).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file +export const withUseServer = serverFn({ method: 'GET' }).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withoutUseServer = serverFn({ method: 'GET' }).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = serverFn({ method: 'GET' }).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = serverFn({ method: 'GET' }).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx index 5b33829a38c..a2206444e3c 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx @@ -1,14 +1,6 @@ import { createClientRpc } from '@tanstack/react-start/client-rpc'; import * as TanStackStart from '@tanstack/react-start'; -export const withUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withoutUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file +export const withUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withoutUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(createClientRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = TanStackStart.createServerFn({ method: 'GET' }).handler(createClientRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = TanStackStart.createServerFn({ method: 'GET' }).handler(createClientRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx index 056535d0bcb..5b1ad05896c 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx @@ -1,5 +1,3 @@ import { createClientRpc } from '@tanstack/react-start/client-rpc'; import { createServerFn } from '@tanstack/react-start'; -export const withUseServer = createServerFn({ - method: 'GET' -}).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); \ No newline at end of file +export const withUseServer = createServerFn({ method: 'GET' }).handler(createClientRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx index 436b8ab4cb3..fb1415f5148 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx @@ -1,37 +1,19 @@ import { createClientRpc } from '@tanstack/react-start/client-rpc'; import { createServerFn, createMiddleware } from '@tanstack/react-start'; -const authMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - auth: 'auth' - } - }); +const authMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { auth: 'auth' } }); }); -const adminMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - admin: 'admin' - } - }); +const adminMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { admin: 'admin' } }); }); export const createAuthServerFn = createServerFn().middleware([authMiddleware]); const createAdminServerFn = createAuthServerFn().middleware([adminMiddleware]); export const myAuthedFn = createAuthServerFn().handler(createClientRpc("3bb88b23926fa224cea3dcfb877026757733d95b42e3b66cf7f06bb89dab06a3")); export const deleteUserFn = createAdminServerFn().handler(createClientRpc("44d9483a9412daaacaa5a8aee6b02294333a0e61b5d3b17ba6bcb34fd2bdce31")); function createFakeFn() { - return { - handler: cb => { - return cb(); - } - }; + return { handler: (cb) => { + return cb(); + } }; } const x = createFakeFn().handler(() => { return 'fakeFn'; diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx index 020d1346e41..b66f9346f68 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx @@ -4,45 +4,26 @@ import { createIsomorphicFn, createServerFn } from '@tanstack/react-start'; import { useState } from 'react'; const getEnv = createIsomorphicFn().server(() => 'server').client(() => 'client'); const getServerEnv = createServerFn().handler(createClientRpc("6049dd46bc00e0980e387f3e74924b40e92f37634a3fe74a1a1facda9e9207c2")); -const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client(input => 'client received ' + input); +const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client((input) => 'client received ' + input); const getServerEcho = createServerFn().handler(createClientRpc("ebb82e0293952b7b1dde3f664dec4c139471c046d06d4dc4ca172f4f45e386d1")); -export const Route = createFileRoute('/isomorphic-fns')({ - component: RouteComponent, - loader() { - return { - envOnLoad: getEnv() - }; - } -}); +export const Route = createFileRoute('/isomorphic-fns')({ component: RouteComponent, loader() { + return { envOnLoad: getEnv() }; +} }); function RouteComponent() { - const { - envOnLoad - } = Route.useLoaderData(); + const { envOnLoad } = Route.useLoaderData(); const [results, setResults] = useState>>(); async function handleClick() { const envOnClick = getEnv(); const echo = getEcho('hello'); - const [serverEnv, serverEcho] = await Promise.all([getServerEnv(), getServerEcho({ - data: 'hello' - })]); - setResults({ - envOnClick, - echo, - serverEnv, - serverEcho - }); + const [serverEnv, serverEcho] = await Promise.all([getServerEnv(), getServerEcho({ data: 'hello' })]); + setResults({ envOnClick, echo, serverEnv, serverEcho }); } - const { - envOnClick, - echo, - serverEnv, - serverEcho - } = results || {}; - return
+ const { envOnClick, echo, serverEnv, serverEcho } = results || {}; + return (
- {!!results &&
+ {!!results && (

getEnv

@@ -62,6 +43,6 @@ function RouteComponent() { When we called the function on the client it returned:
{JSON.stringify(echo)}
-
} -
; +
)} +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructured.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructured.tsx index 37c93d5c002..65ad5b2924f 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructured.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructured.tsx @@ -1,24 +1,10 @@ import { createSsrRpc } from '@tanstack/react-start/ssr-rpc'; import { createServerFn } from '@tanstack/react-start'; import { z } from 'zod'; -export const withUseServer = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withArrowFunction = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793")); -export const withArrowFunctionAndFunction = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e")); -export const withoutUseServer = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = createServerFn({ - method: 'GET' -}).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); -export const withValidatorFn = createServerFn({ - method: 'GET' -}).validator(z.number()).handler(createSsrRpc("5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44")); \ No newline at end of file +export const withUseServer = createServerFn({ method: 'GET' }).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withArrowFunction = createServerFn({ method: 'GET' }).handler(createSsrRpc("a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793")); +export const withArrowFunctionAndFunction = createServerFn({ method: 'GET' }).handler(createSsrRpc("dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e")); +export const withoutUseServer = createServerFn({ method: 'GET' }).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = createServerFn({ method: 'GET' }).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = createServerFn({ method: 'GET' }).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); +export const withValidatorFn = createServerFn({ method: 'GET' }).validator(z.number()).handler(createSsrRpc("5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructuredRename.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructuredRename.tsx index 94a351ffa9d..ecbd9359bb3 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructuredRename.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnDestructuredRename.tsx @@ -1,14 +1,6 @@ import { createSsrRpc } from '@tanstack/react-start/ssr-rpc'; import { createServerFn as serverFn } from '@tanstack/react-start'; -export const withUseServer = serverFn({ - method: 'GET' -}).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withoutUseServer = serverFn({ - method: 'GET' -}).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = serverFn({ - method: 'GET' -}).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = serverFn({ - method: 'GET' -}).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file +export const withUseServer = serverFn({ method: 'GET' }).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withoutUseServer = serverFn({ method: 'GET' }).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = serverFn({ method: 'GET' }).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = serverFn({ method: 'GET' }).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnStarImport.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnStarImport.tsx index 74d22a2fc4c..7631a717b37 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnStarImport.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnStarImport.tsx @@ -1,14 +1,6 @@ import { createSsrRpc } from '@tanstack/react-start/ssr-rpc'; import * as TanStackStart from '@tanstack/react-start'; -export const withUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); -export const withoutUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); -export const withVariable = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); -export const withZodValidator = TanStackStart.createServerFn({ - method: 'GET' -}).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file +export const withUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); +export const withoutUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(createSsrRpc("c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2")); +export const withVariable = TanStackStart.createServerFn({ method: 'GET' }).handler(createSsrRpc("7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70")); +export const withZodValidator = TanStackStart.createServerFn({ method: 'GET' }).handler(createSsrRpc("43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnValidator.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnValidator.tsx index 59fb4d2fd95..4d1bf15d55a 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnValidator.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createServerFnValidator.tsx @@ -1,6 +1,4 @@ import { createSsrRpc } from '@tanstack/react-start/ssr-rpc'; import { createServerFn } from '@tanstack/react-start'; import { z } from 'zod'; -export const withUseServer = createServerFn({ - method: 'GET' -}).validator(z.number()).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); \ No newline at end of file +export const withUseServer = createServerFn({ method: 'GET' }).validator(z.number()).handler(createSsrRpc("b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320")); \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/factory.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/factory.tsx index e82ca932e80..680340038f6 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/factory.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/factory.tsx @@ -1,37 +1,19 @@ import { createSsrRpc } from '@tanstack/react-start/ssr-rpc'; import { createServerFn, createMiddleware } from '@tanstack/react-start'; -const authMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - auth: 'auth' - } - }); +const authMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { auth: 'auth' } }); }); -const adminMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - admin: 'admin' - } - }); +const adminMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { admin: 'admin' } }); }); export const createAuthServerFn = createServerFn().middleware([authMiddleware]); const createAdminServerFn = createAuthServerFn().middleware([adminMiddleware]); export const myAuthedFn = createAuthServerFn().handler(createSsrRpc("3bb88b23926fa224cea3dcfb877026757733d95b42e3b66cf7f06bb89dab06a3")); export const deleteUserFn = createAdminServerFn().handler(createSsrRpc("44d9483a9412daaacaa5a8aee6b02294333a0e61b5d3b17ba6bcb34fd2bdce31")); function createFakeFn() { - return { - handler: cb => { - return cb(); - } - }; + return { handler: (cb) => { + return cb(); + } }; } const x = createFakeFn().handler(() => { return 'fakeFn'; diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/isomorphic-fns.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/isomorphic-fns.tsx index d56d81fddaf..8925d9ecf58 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/isomorphic-fns.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/isomorphic-fns.tsx @@ -4,45 +4,26 @@ import { createIsomorphicFn, createServerFn } from '@tanstack/react-start'; import { useState } from 'react'; const getEnv = createIsomorphicFn().server(() => 'server').client(() => 'client'); const getServerEnv = createServerFn().handler(createSsrRpc("6049dd46bc00e0980e387f3e74924b40e92f37634a3fe74a1a1facda9e9207c2")); -const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client(input => 'client received ' + input); +const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client((input) => 'client received ' + input); const getServerEcho = createServerFn().validator((input: string) => input).handler(createSsrRpc("ebb82e0293952b7b1dde3f664dec4c139471c046d06d4dc4ca172f4f45e386d1")); -export const Route = createFileRoute('/isomorphic-fns')({ - component: RouteComponent, - loader() { - return { - envOnLoad: getEnv() - }; - } -}); +export const Route = createFileRoute('/isomorphic-fns')({ component: RouteComponent, loader() { + return { envOnLoad: getEnv() }; +} }); function RouteComponent() { - const { - envOnLoad - } = Route.useLoaderData(); + const { envOnLoad } = Route.useLoaderData(); const [results, setResults] = useState>>(); async function handleClick() { const envOnClick = getEnv(); const echo = getEcho('hello'); - const [serverEnv, serverEcho] = await Promise.all([getServerEnv(), getServerEcho({ - data: 'hello' - })]); - setResults({ - envOnClick, - echo, - serverEnv, - serverEcho - }); + const [serverEnv, serverEcho] = await Promise.all([getServerEnv(), getServerEcho({ data: 'hello' })]); + setResults({ envOnClick, echo, serverEnv, serverEcho }); } - const { - envOnClick, - echo, - serverEnv, - serverEcho - } = results || {}; - return
+ const { envOnClick, echo, serverEnv, serverEcho } = results || {}; + return (
- {!!results &&
+ {!!results && (

getEnv

@@ -62,6 +43,6 @@ function RouteComponent() { When we called the function on the client it returned:
{JSON.stringify(echo)}
-
} -
; +
)} +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructured.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructured.tsx index 7459b65cc01..36393197df5 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructured.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructured.tsx @@ -1,86 +1,40 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createServerFn } from '@tanstack/react-start'; import { z } from 'zod'; -const withUseServer_createServerFn_handler = createServerRpc({ - id: "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", - name: "withUseServer", - filename: "src/test.ts" -}, opts => withUseServer.__executeServer(opts)); -const withUseServer = createServerFn({ - method: 'GET' -}).handler(withUseServer_createServerFn_handler, async function () { +const withUseServer_createServerFn_handler = createServerRpc({ "id": "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", "name": "withUseServer", "filename": "src/test.ts" }, (opts) => withUseServer.__executeServer(opts)); +const withUseServer = createServerFn({ method: 'GET' }).handler(withUseServer_createServerFn_handler, async function() { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withArrowFunction_createServerFn_handler = createServerRpc({ - id: "a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793", - name: "withArrowFunction", - filename: "src/test.ts" -}, opts => withArrowFunction.__executeServer(opts)); -const withArrowFunction = createServerFn({ - method: 'GET' -}).handler(withArrowFunction_createServerFn_handler, async () => null); -const withArrowFunctionAndFunction_createServerFn_handler = createServerRpc({ - id: "dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e", - name: "withArrowFunctionAndFunction", - filename: "src/test.ts" -}, opts => withArrowFunctionAndFunction.__executeServer(opts)); -const withArrowFunctionAndFunction = createServerFn({ - method: 'GET' -}).handler(withArrowFunctionAndFunction_createServerFn_handler, async () => test()); -const withoutUseServer_createServerFn_handler = createServerRpc({ - id: "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", - name: "withoutUseServer", - filename: "src/test.ts" -}, opts => withoutUseServer.__executeServer(opts)); -const withoutUseServer = createServerFn({ - method: 'GET' -}).handler(withoutUseServer_createServerFn_handler, async () => { +const withArrowFunction_createServerFn_handler = createServerRpc({ "id": "a311dfd9a6554bc0bb9371ef4fbc72c852d0b5532829a2613a29157b8595a793", "name": "withArrowFunction", "filename": "src/test.ts" }, (opts) => withArrowFunction.__executeServer(opts)); +const withArrowFunction = createServerFn({ method: 'GET' }).handler(withArrowFunction_createServerFn_handler, async () => null); +const withArrowFunctionAndFunction_createServerFn_handler = createServerRpc({ "id": "dbe1f77c6ea7590bce3212a75b06d3cee83b425bcf493014cb47462ef725e36e", "name": "withArrowFunctionAndFunction", "filename": "src/test.ts" }, (opts) => withArrowFunctionAndFunction.__executeServer(opts)); +const withArrowFunctionAndFunction = createServerFn({ method: 'GET' }).handler(withArrowFunctionAndFunction_createServerFn_handler, async () => test()); +const withoutUseServer_createServerFn_handler = createServerRpc({ "id": "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", "name": "withoutUseServer", "filename": "src/test.ts" }, (opts) => withoutUseServer.__executeServer(opts)); +const withoutUseServer = createServerFn({ method: 'GET' }).handler(withoutUseServer_createServerFn_handler, async () => { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withVariable_createServerFn_handler = createServerRpc({ - id: "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", - name: "withVariable", - filename: "src/test.ts" -}, opts => withVariable.__executeServer(opts)); -const withVariable = createServerFn({ - method: 'GET' -}).handler(withVariable_createServerFn_handler, abstractedFunction); +const withVariable_createServerFn_handler = createServerRpc({ "id": "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", "name": "withVariable", "filename": "src/test.ts" }, (opts) => withVariable.__executeServer(opts)); +const withVariable = createServerFn({ method: 'GET' }).handler(withVariable_createServerFn_handler, abstractedFunction); async function abstractedFunction() { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); } function zodValidator(schema: TSchema, fn: (input: z.output) => TResult) { return async (input: unknown) => { return fn(schema.parse(input)); }; } -const withZodValidator_createServerFn_handler = createServerRpc({ - id: "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", - name: "withZodValidator", - filename: "src/test.ts" -}, opts => withZodValidator.__executeServer(opts)); -const withZodValidator = createServerFn({ - method: 'GET' -}).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), input => { - return { - 'you gave': input - }; +const withZodValidator_createServerFn_handler = createServerRpc({ "id": "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", "name": "withZodValidator", "filename": "src/test.ts" }, (opts) => withZodValidator.__executeServer(opts)); +const withZodValidator = createServerFn({ method: 'GET' }).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), (input) => { + return { 'you gave': input }; })); -const withValidatorFn_createServerFn_handler = createServerRpc({ - id: "5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44", - name: "withValidatorFn", - filename: "src/test.ts" -}, opts => withValidatorFn.__executeServer(opts)); -const withValidatorFn = createServerFn({ - method: 'GET' -}).validator(z.number()).handler(withValidatorFn_createServerFn_handler, async ({ - input -}) => { +const withValidatorFn_createServerFn_handler = createServerRpc({ "id": "5cf922ac733d835fee496964cbf0b4b4067cb43d51f2efa484d072e6bb7dae44", "name": "withValidatorFn", "filename": "src/test.ts" }, (opts) => withValidatorFn.__executeServer(opts)); +const withValidatorFn = createServerFn({ method: 'GET' }).validator(z.number()).handler(withValidatorFn_createServerFn_handler, async ({ input }) => { return null; }); export { withUseServer_createServerFn_handler, withArrowFunction_createServerFn_handler, withArrowFunctionAndFunction_createServerFn_handler, withoutUseServer_createServerFn_handler, withVariable_createServerFn_handler, withZodValidator_createServerFn_handler, withValidatorFn_createServerFn_handler }; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructuredRename.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructuredRename.tsx index fd5a36351bd..6af328c84ae 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructuredRename.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnDestructuredRename.tsx @@ -1,58 +1,32 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createServerFn as serverFn } from '@tanstack/react-start'; import { z } from 'zod'; -const withUseServer_createServerFn_handler = createServerRpc({ - id: "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", - name: "withUseServer", - filename: "src/test.ts" -}, opts => withUseServer.__executeServer(opts)); -const withUseServer = serverFn({ - method: 'GET' -}).handler(withUseServer_createServerFn_handler, async function () { +const withUseServer_createServerFn_handler = createServerRpc({ "id": "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", "name": "withUseServer", "filename": "src/test.ts" }, (opts) => withUseServer.__executeServer(opts)); +const withUseServer = serverFn({ method: 'GET' }).handler(withUseServer_createServerFn_handler, async function() { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withoutUseServer_createServerFn_handler = createServerRpc({ - id: "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", - name: "withoutUseServer", - filename: "src/test.ts" -}, opts => withoutUseServer.__executeServer(opts)); -const withoutUseServer = serverFn({ - method: 'GET' -}).handler(withoutUseServer_createServerFn_handler, async () => { +const withoutUseServer_createServerFn_handler = createServerRpc({ "id": "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", "name": "withoutUseServer", "filename": "src/test.ts" }, (opts) => withoutUseServer.__executeServer(opts)); +const withoutUseServer = serverFn({ method: 'GET' }).handler(withoutUseServer_createServerFn_handler, async () => { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withVariable_createServerFn_handler = createServerRpc({ - id: "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", - name: "withVariable", - filename: "src/test.ts" -}, opts => withVariable.__executeServer(opts)); -const withVariable = serverFn({ - method: 'GET' -}).handler(withVariable_createServerFn_handler, abstractedFunction); +const withVariable_createServerFn_handler = createServerRpc({ "id": "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", "name": "withVariable", "filename": "src/test.ts" }, (opts) => withVariable.__executeServer(opts)); +const withVariable = serverFn({ method: 'GET' }).handler(withVariable_createServerFn_handler, abstractedFunction); async function abstractedFunction() { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); } function zodValidator(schema: TSchema, fn: (input: z.output) => TResult) { return async (input: unknown) => { return fn(schema.parse(input)); }; } -const withZodValidator_createServerFn_handler = createServerRpc({ - id: "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", - name: "withZodValidator", - filename: "src/test.ts" -}, opts => withZodValidator.__executeServer(opts)); -const withZodValidator = serverFn({ - method: 'GET' -}).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), input => { - return { - 'you gave': input - }; +const withZodValidator_createServerFn_handler = createServerRpc({ "id": "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", "name": "withZodValidator", "filename": "src/test.ts" }, (opts) => withZodValidator.__executeServer(opts)); +const withZodValidator = serverFn({ method: 'GET' }).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), (input) => { + return { 'you gave': input }; })); export { withUseServer_createServerFn_handler, withoutUseServer_createServerFn_handler, withVariable_createServerFn_handler, withZodValidator_createServerFn_handler }; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnStarImport.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnStarImport.tsx index e759e35f42d..c9ef387a8bf 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnStarImport.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnStarImport.tsx @@ -1,60 +1,33 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import * as TanStackStart from '@tanstack/react-start'; import { z } from 'zod'; -const withUseServer_createServerFn_handler = createServerRpc({ - id: "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", - name: "withUseServer", - filename: "src/test.ts" -}, opts => withUseServer.__executeServer(opts)); -const withUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(withUseServer_createServerFn_handler, async function () { +const withUseServer_createServerFn_handler = createServerRpc({ "id": "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", "name": "withUseServer", "filename": "src/test.ts" }, (opts) => withUseServer.__executeServer(opts)); +const withUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(withUseServer_createServerFn_handler, async function() { 'use server'; - console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withoutUseServer_createServerFn_handler = createServerRpc({ - id: "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", - name: "withoutUseServer", - filename: "src/test.ts" -}, opts => withoutUseServer.__executeServer(opts)); -const withoutUseServer = TanStackStart.createServerFn({ - method: 'GET' -}).handler(withoutUseServer_createServerFn_handler, async () => { +const withoutUseServer_createServerFn_handler = createServerRpc({ "id": "c0d9fdeb2b01aafecc782f439416b86f666cb5334ac9a934546b177e5698bbb2", "name": "withoutUseServer", "filename": "src/test.ts" }, (opts) => withoutUseServer.__executeServer(opts)); +const withoutUseServer = TanStackStart.createServerFn({ method: 'GET' }).handler(withoutUseServer_createServerFn_handler, async () => { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); }); -const withVariable_createServerFn_handler = createServerRpc({ - id: "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", - name: "withVariable", - filename: "src/test.ts" -}, opts => withVariable.__executeServer(opts)); -const withVariable = TanStackStart.createServerFn({ - method: 'GET' -}).handler(withVariable_createServerFn_handler, abstractedFunction); +const withVariable_createServerFn_handler = createServerRpc({ "id": "7d36cb30c30bd688b9773bd7f85a0d51d83f868255e127605e4f236615fefe70", "name": "withVariable", "filename": "src/test.ts" }, (opts) => withVariable.__executeServer(opts)); +const withVariable = TanStackStart.createServerFn({ method: 'GET' }).handler(withVariable_createServerFn_handler, abstractedFunction); async function abstractedFunction() { console.info('Fetching posts...'); - await new Promise(r => setTimeout(r, 500)); - return axios.get>('https://jsonplaceholder.typicode.com/posts').then(r => r.data.slice(0, 10)); + await new Promise((r) => setTimeout(r, 500)); + return axios.get>('https://jsonplaceholder.typicode.com/posts').then((r) => r.data.slice(0, 10)); } function zodValidator(schema: TSchema, fn: (input: z.output) => TResult) { return async (input: unknown) => { return fn(schema.parse(input)); }; } -const withZodValidator_createServerFn_handler = createServerRpc({ - id: "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", - name: "withZodValidator", - filename: "src/test.ts" -}, opts => withZodValidator.__executeServer(opts)); -const withZodValidator = TanStackStart.createServerFn({ - method: 'GET' -}).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), input => { - return { - 'you gave': input - }; +const withZodValidator_createServerFn_handler = createServerRpc({ "id": "43606a369c85444a332f701d6399564b6a3691aabab63dfc9a0b7c341fb798f3", "name": "withZodValidator", "filename": "src/test.ts" }, (opts) => withZodValidator.__executeServer(opts)); +const withZodValidator = TanStackStart.createServerFn({ method: 'GET' }).handler(withZodValidator_createServerFn_handler, zodValidator(z.number(), (input) => { + return { 'you gave': input }; })); export { withUseServer_createServerFn_handler, withoutUseServer_createServerFn_handler, withVariable_createServerFn_handler, withZodValidator_createServerFn_handler }; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnValidator.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnValidator.tsx index 66bcb9376e2..24df391b1f6 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnValidator.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createServerFnValidator.tsx @@ -1,14 +1,6 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createServerFn } from '@tanstack/react-start'; import { z } from 'zod'; -const withUseServer_createServerFn_handler = createServerRpc({ - id: "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", - name: "withUseServer", - filename: "src/test.ts" -}, opts => withUseServer.__executeServer(opts)); -const withUseServer = createServerFn({ - method: 'GET' -}).validator(z.number()).handler(withUseServer_createServerFn_handler, ({ - input -}) => input + 1); +const withUseServer_createServerFn_handler = createServerRpc({ "id": "b6fe31e85836ae6c65d8ab262dd1af6a68620aeef609029d50127f4cceaaf320", "name": "withUseServer", "filename": "src/test.ts" }, (opts) => withUseServer.__executeServer(opts)); +const withUseServer = createServerFn({ method: 'GET' }).validator(z.number()).handler(withUseServer_createServerFn_handler, ({ input }) => input + 1); export { withUseServer_createServerFn_handler }; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/factory.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/factory.tsx index 5a2c26fe0b2..dbd95386869 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/factory.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/factory.tsx @@ -1,51 +1,25 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createServerFn, createMiddleware } from '@tanstack/react-start'; -const authMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - auth: 'auth' - } - }); +const authMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { auth: 'auth' } }); }); -const adminMiddleware = createMiddleware({ - type: 'function' -}).server(({ - next -}) => { - return next({ - context: { - admin: 'admin' - } - }); +const adminMiddleware = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { admin: 'admin' } }); }); const createAuthServerFn = createServerFn().middleware([authMiddleware]); const createAdminServerFn = createAuthServerFn().middleware([adminMiddleware]); -const myAuthedFn_createServerFn_handler = createServerRpc({ - id: "3bb88b23926fa224cea3dcfb877026757733d95b42e3b66cf7f06bb89dab06a3", - name: "myAuthedFn", - filename: "src/test.ts" -}, opts => myAuthedFn.__executeServer(opts)); +const myAuthedFn_createServerFn_handler = createServerRpc({ "id": "3bb88b23926fa224cea3dcfb877026757733d95b42e3b66cf7f06bb89dab06a3", "name": "myAuthedFn", "filename": "src/test.ts" }, (opts) => myAuthedFn.__executeServer(opts)); const myAuthedFn = createAuthServerFn().handler(myAuthedFn_createServerFn_handler, () => { return 'myAuthedFn'; }); -const deleteUserFn_createServerFn_handler = createServerRpc({ - id: "44d9483a9412daaacaa5a8aee6b02294333a0e61b5d3b17ba6bcb34fd2bdce31", - name: "deleteUserFn", - filename: "src/test.ts" -}, opts => deleteUserFn.__executeServer(opts)); +const deleteUserFn_createServerFn_handler = createServerRpc({ "id": "44d9483a9412daaacaa5a8aee6b02294333a0e61b5d3b17ba6bcb34fd2bdce31", "name": "deleteUserFn", "filename": "src/test.ts" }, (opts) => deleteUserFn.__executeServer(opts)); const deleteUserFn = createAdminServerFn().handler(deleteUserFn_createServerFn_handler, () => { return 'deleteUserFn'; }); function createFakeFn() { - return { - handler: cb => { - return cb(); - } - }; + return { handler: (cb) => { + return cb(); + } }; } const x = createFakeFn().handler(() => { return 'fakeFn'; diff --git a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/isomorphic-fns.tsx b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/isomorphic-fns.tsx index a65629abd0b..b1df6b2a64e 100644 --- a/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/isomorphic-fns.tsx +++ b/packages/start-plugin-core/tests/createServerFn/snapshots/server-provider/isomorphic-fns.tsx @@ -1,19 +1,9 @@ import { createServerRpc } from '@tanstack/react-start/server-rpc'; import { createIsomorphicFn, createServerFn } from '@tanstack/react-start'; const getEnv = createIsomorphicFn().server(() => 'server').client(() => 'client'); -const getServerEnv_createServerFn_handler = createServerRpc({ - id: "6049dd46bc00e0980e387f3e74924b40e92f37634a3fe74a1a1facda9e9207c2", - name: "getServerEnv", - filename: "src/test.ts" -}, opts => getServerEnv.__executeServer(opts)); +const getServerEnv_createServerFn_handler = createServerRpc({ "id": "6049dd46bc00e0980e387f3e74924b40e92f37634a3fe74a1a1facda9e9207c2", "name": "getServerEnv", "filename": "src/test.ts" }, (opts) => getServerEnv.__executeServer(opts)); const getServerEnv = createServerFn().handler(getServerEnv_createServerFn_handler, () => getEnv()); -const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client(input => 'client received ' + input); -const getServerEcho_createServerFn_handler = createServerRpc({ - id: "ebb82e0293952b7b1dde3f664dec4c139471c046d06d4dc4ca172f4f45e386d1", - name: "getServerEcho", - filename: "src/test.ts" -}, opts => getServerEcho.__executeServer(opts)); -const getServerEcho = createServerFn().validator((input: string) => input).handler(getServerEcho_createServerFn_handler, ({ - data -}) => getEcho(data)); +const getEcho = createIsomorphicFn().server((input: string) => 'server received ' + input).client((input) => 'client received ' + input); +const getServerEcho_createServerFn_handler = createServerRpc({ "id": "ebb82e0293952b7b1dde3f664dec4c139471c046d06d4dc4ca172f4f45e386d1", "name": "getServerEcho", "filename": "src/test.ts" }, (opts) => getServerEcho.__executeServer(opts)); +const getServerEcho = createServerFn().validator((input: string) => input).handler(getServerEcho_createServerFn_handler, ({ data }) => getEcho(data)); export { getServerEnv_createServerFn_handler, getServerEcho_createServerFn_handler }; \ No newline at end of file diff --git a/packages/start-plugin-core/tests/envOnly/snapshots/client/envOnlyFactory.tsx b/packages/start-plugin-core/tests/envOnly/snapshots/client/envOnlyFactory.tsx index 6a29fcbfe64..4104b72570a 100644 --- a/packages/start-plugin-core/tests/envOnly/snapshots/client/envOnlyFactory.tsx +++ b/packages/start-plugin-core/tests/envOnly/snapshots/client/envOnlyFactory.tsx @@ -4,7 +4,6 @@ export function createServerFactory(name: string) { throw new Error("createServerOnlyFn() functions can only be called on the server!"); }; } - // Client-only function factory export function createClientFactory(name: string) { return () => { @@ -12,19 +11,16 @@ export function createClientFactory(name: string) { return `client-${name}`; }; } - // Arrow function server factory export const createServerArrowFactory = (prefix: string) => { return () => { throw new Error("createServerOnlyFn() functions can only be called on the server!"); }; }; - // Arrow function client factory export const createClientArrowFactory = (prefix: string) => { return () => `${prefix}-client`; }; - // Top-level for comparison export const topLevelServerFn = () => { throw new Error("createServerOnlyFn() functions can only be called on the server!"); diff --git a/packages/start-plugin-core/tests/envOnly/snapshots/server/envOnlyFactory.tsx b/packages/start-plugin-core/tests/envOnly/snapshots/server/envOnlyFactory.tsx index 58b2483a48d..f5e039041f7 100644 --- a/packages/start-plugin-core/tests/envOnly/snapshots/server/envOnlyFactory.tsx +++ b/packages/start-plugin-core/tests/envOnly/snapshots/server/envOnlyFactory.tsx @@ -5,26 +5,22 @@ export function createServerFactory(name: string) { return `server-${name}`; }; } - // Client-only function factory export function createClientFactory(name: string) { return () => { throw new Error("createClientOnlyFn() functions can only be called on the client!"); }; } - // Arrow function server factory export const createServerArrowFactory = (prefix: string) => { return () => `${prefix}-server`; }; - // Arrow function client factory export const createClientArrowFactory = (prefix: string) => { return () => { throw new Error("createClientOnlyFn() functions can only be called on the client!"); }; }; - // Top-level for comparison export const topLevelServerFn = () => 'server'; export const topLevelClientFn = () => { diff --git a/packages/start-plugin-core/tests/hydrate-when-transform.test.ts b/packages/start-plugin-core/tests/hydrate-when-transform.test.ts index 442482bd86c..9b0ec92f762 100644 --- a/packages/start-plugin-core/tests/hydrate-when-transform.test.ts +++ b/packages/start-plugin-core/tests/hydrate-when-transform.test.ts @@ -1,8 +1,14 @@ import { mkdtempSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import * as t from '@babel/types' -import { generateFromAst, parseAst } from '@tanstack/router-utils' +import { walk } from 'yuku-ast' +import { + analyzeModule, + cloneModuleAst, + generateModule, + parseExpression, + removeUnusedBindings, +} from '@tanstack/router-utils' import { describe, expect, test } from 'vitest' import { createHydrateCompilerPlugin } from '../src/hydrate-when-transform' import type { CompileStartFrameworkOptions } from '../src/types' @@ -70,9 +76,12 @@ function compileHydrate(options: { }) { const plugin = options.plugin ?? createHydrateCompilerPlugin() const envName = options.envName ?? options.env - const ast = parseAst({ code: options.code, sourceFilename: options.id }) + const module = analyzeModule({ code: options.code, filename: options.id }) + const { program: ast, originalNodes } = cloneModuleAst(module) const result = plugin.transformAst?.({ ast, + module, + originalNodes, code: options.code, id: options.id, root: options.root, @@ -81,14 +90,37 @@ function compileHydrate(options: { mode: 'dev', framework: options.framework ?? 'react', providerEnvName: 'ssr', - types: t, - parseExpression: (expressionCode) => t.identifier(expressionCode), + parseExpression, + replaceNode(node, replacement) { + walk(ast, { + enter(current, context) { + if (current === node) { + context.replace(replacement) + context.stop() + } + }, + }) + }, + parentOf(node) { + let parent: import('@yuku-toolchain/types').Node | null = null + walk(ast, { + enter(current, context) { + if (current === node) { + parent = context.parent + context.stop() + } + }, + }) + return parent + }, }) - if (!result) return null + if (!result) { + return null + } - const generated = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: options.id, + removeUnusedBindings(module, ast, originalNodes) + const generated = generateModule(ast, { + source: options.code, filename: options.id, }) @@ -156,13 +188,16 @@ const props = { when: true, fallback:

server-fallback

}`, 'strips fallback from a parenthesized spread %s', (spread) => { const result = compileHydrate({ - code: `import { Hydrate } from '@tanstack/react-start'; ${spread.includes('props') ? 'const props = ({ fallback:

server-fallback

});' : ''} export function Page() { return

child

}`, + code: `import { Hydrate } from '@tanstack/react-start'; const props = ({ fallback:

server-fallback

}); export function Page() { return

child

}`, id, root, env: 'server', }) - expect(result).not.toBeNull() - expect(result?.code).not.toContain('server-fallback') + // An unused declaration is deliberately preserved; only the used spread + // binding should lose its fallback. + expect(result?.code.match(/server-fallback/g) ?? []).toHaveLength( + spread.includes('props') ? 0 : 1, + ) }, ) @@ -173,7 +208,6 @@ const props = { when: true, fallback:

server-fallback

}`, root, env: 'server', }) - expect(result).not.toBeNull() expect(result?.code).not.toContain('server-fallback') }) @@ -186,7 +220,6 @@ const props = { when: true, fallback:

server-fallback

}`, root, env: 'client', }) - expect(result).not.toBeNull() expect(result?.code).not.toContain('.preload') }, ) diff --git a/packages/start-plugin-core/tests/hydrateWhen/hydrateWhen.test.ts b/packages/start-plugin-core/tests/hydrateWhen/hydrateWhen.test.ts index a027fac5057..d092707e7a3 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/hydrateWhen.test.ts +++ b/packages/start-plugin-core/tests/hydrateWhen/hydrateWhen.test.ts @@ -1,7 +1,12 @@ import { readFile, readdir } from 'node:fs/promises' -import { traverse } from '@babel/core' -import * as t from '@babel/types' -import { generateFromAst, parseAst } from '@tanstack/router-utils' +import { walk } from 'yuku-ast' +import { + analyzeModule, + cloneModuleAst, + generateModule, + parseExpression, + removeUnusedBindings, +} from '@tanstack/router-utils' import path from 'pathe' import { describe, expect, test } from 'vitest' import { createHydrateCompilerPlugin } from '../../src/hydrate-when-transform' @@ -73,9 +78,12 @@ function compile(opts: { root: opts.root ?? fixtureRoot, } const plugin = createHydrateCompilerPlugin() - const ast = parseAst({ code: options.code, sourceFilename: options.id }) + const module = analyzeModule({ code: options.code, filename: options.id }) + const { program: ast, originalNodes } = cloneModuleAst(module) const result = plugin.transformAst?.({ ast, + module, + originalNodes, code: options.code, id: options.id, root: options.root, @@ -84,14 +92,37 @@ function compile(opts: { mode: 'dev', framework: 'react', providerEnvName: 'ssr', - types: t, - parseExpression: (expressionCode) => t.identifier(expressionCode), + parseExpression, + replaceNode(node, replacement) { + walk(ast, { + enter(current, context) { + if (current === node) { + context.replace(replacement) + context.stop() + } + }, + }) + }, + parentOf(node) { + let parent: import('@yuku-toolchain/types').Node | null = null + walk(ast, { + enter(current, context) { + if (current === node) { + parent = context.parent + context.stop() + } + }, + }) + return parent + }, }) - if (!result) return null + if (!result) { + return null + } - const generated = generateFromAst(ast, { - sourceMaps: true, - sourceFileName: options.id, + removeUnusedBindings(module, ast, originalNodes) + const generated = generateModule(ast, { + source: options.code, filename: options.id, }) @@ -156,16 +187,10 @@ describe('Hydrate compiler transform fixtures', async () => { code, id: fixtureId('global.tsx'), })! - const output = parseAst({ code: compiled.code }) - const globalReferences: Array = [] - traverse(output, { - ReferencedIdentifier(path) { - if (path.node.name === '_H0' && !path.scope.hasBinding('_H0', true)) { - globalReferences.push(path.node.name) - } - }, - }) - expect(globalReferences).toEqual(['_H0']) + const output = analyzeModule({ code: compiled.code }) + expect( + output.unresolvedReferences.some((reference) => reference.name === '_H0'), + ).toBe(true) }) test('retains captured local components and values across extraction', async () => { @@ -190,20 +215,13 @@ describe('Hydrate compiler transform fixtures', async () => { root: fixtureRoot, }) expect(loaded).toBeTruthy() - const output = parseAst({ code: loaded!.code }) - const capturedReferences = new Set() - traverse(output, { - Program(path) { - expect(path.scope.getBinding('Page')).toBeUndefined() - }, - ReferencedIdentifier(path) { - if (['Local', 'count', 'name'].includes(path.node.name)) { - capturedReferences.add(path.node.name) - expect(path.scope.hasBinding(path.node.name, true)).toBe(true) - } - }, - }) - expect([...capturedReferences].sort()).toEqual(['Local', 'count', 'name']) + const output = analyzeModule({ code: loaded!.code }) + expect(output.rootScope.find('Page')).toBeNull() + expect( + output.unresolvedReferences.filter((reference) => + ['Local', 'count', 'name'].includes(reference.name), + ), + ).toHaveLength(0) }) test('should extract virtual modules and keep nested ids stable', async () => { diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenBasic.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenBasic.tsx index f1d2243d685..6417a894802 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenBasic.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenBasic.tsx @@ -1,18 +1,11 @@ -const _H = _lazyRouteComponent(() => import("/hydrateWhenBasic.tsx?tss-hydrate=0_3cf0187f82"), "H0"), - _H0_preload = _H.preload; import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenBasic.tsx?tss-hydrate=0_3cf0187f82"), "H0"); +const _H0_preload = _H0.preload; import { Hydrate } from '@tanstack/react-start'; import { idle, visible } from '@tanstack/react-start/hydration'; import { FallbackPane } from './widgets'; export function Page() { - return
- } h="0_3cf0187f82" p={_H0_preload}> -{<_H />} - -
; + return (
+ } h="0_3cf0187f82" p={_H0_preload}>{<_H0 />} +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenMultiple.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenMultiple.tsx index 73070a4fe19..6c552f469db 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenMultiple.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenMultiple.tsx @@ -1,19 +1,13 @@ -const _H3 = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=2_21aa371e0f"), "H2"); -const _H2 = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=1_21aa371e0f"), "H1"); -const _H = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=0_21aa371e0f"), "H0"); import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=0_21aa371e0f"), "H0"); +const _H1 = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=1_21aa371e0f"), "H1"); +const _H2 = _lazyRouteComponent(() => import("/hydrateWhenMultiple.tsx?tss-hydrate=2_21aa371e0f"), "H2"); import { Hydrate } from '@tanstack/react-start'; import { load, media, visible } from '@tanstack/react-start/hydration'; export function Page() { - return <> - -{<_H />} - - -{<_H2 />} - - -{<_H3 />} - - ; + return (<> + {<_H0 />} + {<_H1 />} + {<_H2 />} + ); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNested.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNested.tsx index 70fe4ce8624..722ba82762f 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNested.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNested.tsx @@ -1,16 +1,12 @@ -const _H2 = _lazyRouteComponent(() => import("/hydrateWhenNested.tsx?tss-hydrate=2_466696e41d"), "H2"); -const _H = _lazyRouteComponent(() => import("/hydrateWhenNested.tsx?tss-hydrate=0_466696e41d"), "H0"); import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenNested.tsx?tss-hydrate=0_466696e41d"), "H0"); +const _H2 = _lazyRouteComponent(() => import("/hydrateWhenNested.tsx?tss-hydrate=2_466696e41d"), "H2"); import { Hydrate } from '@tanstack/react-start'; import { idle, visible } from '@tanstack/react-start/hydration'; const unused = 'remove me from virtual modules'; export function Page() { - return <> - -{<_H />} - - -{<_H2 />} - - ; + return (<> + {<_H0 />} + {<_H2 />} + ); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNever.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNever.tsx index 4d135f70f41..130ee5107c2 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNever.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenNever.tsx @@ -1,9 +1,7 @@ -const _H = _lazyRouteComponent(() => import("/hydrateWhenNever.tsx?tss-hydrate=0_b752509d76"), "H0"); import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenNever.tsx?tss-hydrate=0_b752509d76"), "H0"); import { Hydrate } from '@tanstack/react-start'; import { never } from '@tanstack/react-start/hydration'; export function Page() { - return -{<_H />} -; + return ({<_H0 />}); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenObjectFallback.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenObjectFallback.tsx index 1fc3dc39a95..1b99086fa0c 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenObjectFallback.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenObjectFallback.tsx @@ -1,26 +1,14 @@ -const _H3 = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=2_7f4dc3aa80"), "H2"); -const _H2 = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=1_7f4dc3aa80"), "H1"); -const _H = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=0_7f4dc3aa80"), "H0"); import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=0_7f4dc3aa80"), "H0"); +const _H1 = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=1_7f4dc3aa80"), "H1"); +const _H2 = _lazyRouteComponent(() => import("/hydrateWhenObjectFallback.tsx?tss-hydrate=2_7f4dc3aa80"), "H2"); import { Hydrate } from '@tanstack/react-start'; import { idle, visible } from '@tanstack/react-start/hydration'; -const spreadProps = { - when: visible(), - fallback:
Bound
-}; +const spreadProps = { when: visible(), fallback:
Bound
}; export function Page() { - return <> - Direct} h="0_7f4dc3aa80"> -{<_H />} - - Inline - }} h="1_7f4dc3aa80"> -{<_H2 />} - - -{<_H3 />} - - ; + return (<> + Direct} h="0_7f4dc3aa80">{<_H0 />} + Inline }} h="1_7f4dc3aa80">{<_H1 />} + {<_H2 />} + ); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenPrefetchState.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenPrefetchState.tsx index 56bc8896ceb..ba3c531780f 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenPrefetchState.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenPrefetchState.tsx @@ -1,19 +1,17 @@ -const _H = _lazyRouteComponent(() => import("/hydrateWhenPrefetchState.tsx?tss-hydrate=0_24b5f958eb"), "H0"), - _H0_preload = _H.preload; import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenPrefetchState.tsx?tss-hydrate=0_24b5f958eb"), "H0"); +const _H0_preload = _H0.preload; import { useState } from 'react'; import { Hydrate } from '@tanstack/react-start'; import { interaction } from '@tanstack/react-start/hydration'; export function Page() { const [status, setStatus] = useState('idle'); const [, setUnusedStatus] = useState('idle'); - return
+ return (

{status}

{ - setStatus('prefetched'); - setUnusedStatus('prefetched'); - }} h="0_24b5f958eb" p={_H0_preload}> -{<_H />} - -
; + setStatus('prefetched'); + setUnusedStatus('prefetched'); + }} h="0_24b5f958eb" p={_H0_preload}>{<_H0 />} +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenRenamed.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenRenamed.tsx index 13b86d4d5d3..dc11f8960db 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenRenamed.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/client/hydrateWhenRenamed.tsx @@ -1,11 +1,7 @@ -const _H = _lazyRouteComponent(() => import("/hydrateWhenRenamed.tsx?tss-hydrate=0_f555ef3ac2"), "H0"); import { lazyRouteComponent as _lazyRouteComponent } from "@tanstack/react-router"; +const _H0 = _lazyRouteComponent(() => import("/hydrateWhenRenamed.tsx?tss-hydrate=0_f555ef3ac2"), "H0"); import { Hydrate as HW } from '@tanstack/react-start'; import { interaction } from '@tanstack/react-start/hydration'; export function Page() { - return -{<_H />} -; + return ({<_H0 />}); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenBasic.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenBasic.tsx index 8bcf4099ca0..427979d0908 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenBasic.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenBasic.tsx @@ -4,14 +4,9 @@ import { Chart } from './widgets'; import { formatValue } from './format'; const chartTitle = formatValue('Revenue'); export function Page() { - return
- + return (
+ -
; +
); } \ No newline at end of file diff --git a/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenMultiple.tsx b/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenMultiple.tsx index 6959b25b3e7..04ae1eb8d9f 100644 --- a/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenMultiple.tsx +++ b/packages/start-plugin-core/tests/hydrateWhen/snapshots/server/hydrateWhenMultiple.tsx @@ -10,7 +10,7 @@ function Footer() { return
Footer
; } export function Page() { - return <> + return (<> @@ -20,5 +20,5 @@ export function Page() {